Skip to content

Commit 4a26139

Browse files
brsonalexcrichton
authored andcommitted
---
yaml --- r: 125723 b: refs/heads/try c: ec0f1cb h: refs/heads/master i: 125721: 8003754 125719: 2184281 v: v3
1 parent d4bdfae commit 4a26139

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
@@ -2,7 +2,7 @@
22
refs/heads/master: f2fa55903e378368ed9173560f03a0ef16e371c2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9fc8394d3bce22ab483f98842434c84c396212ae
5-
refs/heads/try: c88bf10c37d32f18774cfa3ef480eb77df294565
5+
refs/heads/try: ec0f1cb709cb59e160083cb95f99aa8fc851a9b8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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/try/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)