File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
branches/auto/src/librustc Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
13
13
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
14
14
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
15
15
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16
- refs/heads/auto: c88bf10c37d32f18774cfa3ef480eb77df294565
16
+ refs/heads/auto: ec0f1cb709cb59e160083cb95f99aa8fc851a9b8
17
17
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
18
18
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
19
19
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ pub struct Options {
97
97
pub color : ColorConfig ,
98
98
pub externs : HashMap < String , Vec < String > > ,
99
99
pub crate_name : Option < String > ,
100
+ pub alt_std_name : Option < String >
100
101
}
101
102
102
103
/// Some reasonable defaults
@@ -124,6 +125,7 @@ pub fn basic_options() -> Options {
124
125
color : Auto ,
125
126
externs : HashMap :: new ( ) ,
126
127
crate_name : None ,
128
+ alt_std_name : None ,
127
129
}
128
130
}
129
131
@@ -787,6 +789,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
787
789
color : color,
788
790
externs : externs,
789
791
crate_name : crate_name,
792
+ alt_std_name : None
790
793
}
791
794
}
792
795
Original file line number Diff line number Diff line change @@ -60,9 +60,16 @@ struct StandardLibraryInjector<'a> {
60
60
61
61
impl < ' a > fold:: Folder for StandardLibraryInjector < ' a > {
62
62
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
+
63
70
let mut vis = vec ! ( ast:: ViewItem {
64
71
node: ast:: ViewItemExternCrate ( token:: str_to_ident( "std" ) ,
65
- None ,
72
+ Some ( ( actual_crate_name , ast :: CookedStr ) ) ,
66
73
ast:: DUMMY_NODE_ID ) ,
67
74
attrs: vec!(
68
75
attr:: mk_attr_outer( attr:: mk_attr_id( ) , attr:: mk_list_item(
You can’t perform that action at this time.
0 commit comments