Skip to content

Commit 65a5705

Browse files
brsonalexcrichton
authored andcommitted
---
yaml --- r: 132027 b: refs/heads/dist-snap c: ec0f1cb h: refs/heads/master i: 132025: 39aac31 132023: 445d677 v: v3
1 parent 35d91a6 commit 65a5705

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
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c88bf10c37d32f18774cfa3ef480eb77df294565
9+
refs/heads/dist-snap: ec0f1cb709cb59e160083cb95f99aa8fc851a9b8
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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)