File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
branches/dist-snap/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 @@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: c88bf10c37d32f18774cfa3ef480eb77df294565
9
+ refs/heads/dist-snap: ec0f1cb709cb59e160083cb95f99aa8fc851a9b8
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
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