Skip to content

Commit 0f15496

Browse files
brsonalexcrichton
authored andcommitted
---
yaml --- r: 124815 b: refs/heads/auto c: ec0f1cb h: refs/heads/master i: 124813: fb96ff8 124811: 80d9251 124807: 97c6213 124799: e25f2c0 v: v3
1 parent b546c20 commit 0f15496

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: c88bf10c37d32f18774cfa3ef480eb77df294565
16+
refs/heads/auto: ec0f1cb709cb59e160083cb95f99aa8fc851a9b8
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/driver/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub struct Options {
9797
pub color: ColorConfig,
9898
pub externs: HashMap<String, Vec<String>>,
9999
pub crate_name: Option<String>,
100+
pub alt_std_name: Option<String>
100101
}
101102

102103
/// Some reasonable defaults
@@ -124,6 +125,7 @@ pub fn basic_options() -> Options {
124125
color: Auto,
125126
externs: HashMap::new(),
126127
crate_name: None,
128+
alt_std_name: None,
127129
}
128130
}
129131

@@ -787,6 +789,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
787789
color: color,
788790
externs: externs,
789791
crate_name: crate_name,
792+
alt_std_name: None
790793
}
791794
}
792795

branches/auto/src/librustc/front/std_inject.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,16 @@ struct StandardLibraryInjector<'a> {
6060

6161
impl<'a> fold::Folder for StandardLibraryInjector<'a> {
6262
fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
63+
64+
// The name to use in `extern crate std = "name";`
65+
let actual_crate_name = match self.sess.opts.alt_std_name {
66+
Some(ref s) => token::intern_and_get_ident(s.as_slice()),
67+
None => token::intern_and_get_ident("std"),
68+
};
69+
6370
let mut vis = vec!(ast::ViewItem {
6471
node: ast::ViewItemExternCrate(token::str_to_ident("std"),
65-
None,
72+
Some((actual_crate_name, ast::CookedStr)),
6673
ast::DUMMY_NODE_ID),
6774
attrs: vec!(
6875
attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_list_item(

0 commit comments

Comments
 (0)