name = "alloc"
version = "0.0.0"
dependencies = [
+ "compiler_builtins 0.0.0",
"core 0.0.0",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"std_unicode 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
"libc 0.0.0",
]
version = "0.0.0"
dependencies = [
"alloc 0.0.0",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
"dlmalloc 0.0.0",
"libc 0.0.0",
version = "0.0.0"
dependencies = [
"alloc 0.0.0",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
name = "libc"
version = "0.0.0"
dependencies = [
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
name = "panic_abort"
version = "0.0.0"
dependencies = [
+ "compiler_builtins 0.0.0",
"core 0.0.0",
"libc 0.0.0",
]
version = "0.0.0"
dependencies = [
"alloc 0.0.0",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
"libc 0.0.0",
"unwind 0.0.0",
version = "0.0.0"
dependencies = [
"cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
name = "std_unicode"
version = "0.0.0"
dependencies = [
+ "compiler_builtins 0.0.0",
"core 0.0.0",
]
name = "unwind"
version = "0.0.0"
dependencies = [
+ "compiler_builtins 0.0.0",
"core 0.0.0",
"libc 0.0.0",
]
[dependencies]
core = { path = "../libcore" }
std_unicode = { path = "../libstd_unicode" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
[dev-dependencies]
rand = "0.4"
alloc_system = { path = "../liballoc_system" }
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
[build-dependencies]
build_helper = { path = "../build_helper" }
alloc = { path = "../liballoc" }
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
# See comments in the source for what this dependency is
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
[dependencies]
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
unwind = { path = "../libunwind" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
[dependencies]
core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
[build-dependencies]
cc = "1.0.1"
alloc = { path = "../liballoc" }
alloc_system = { path = "../liballoc_system" }
core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
alloc = { path = "../liballoc" }
alloc_system = { path = "../liballoc_system" }
core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
alloc = { path = "../liballoc" }
alloc_system = { path = "../liballoc_system" }
core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
alloc = { path = "../liballoc" }
alloc_system = { path = "../liballoc_system" }
core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
// compiler-rt intrinsics
#[doc(masked)]
+#[cfg(stage0)]
extern crate compiler_builtins;
// During testing, this crate is not actually the "real" std library, but rather
[dependencies]
core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
is_expanded: bool) -> io::Result<()> {
let mut s = State::new_from_input(cm, sess, filename, input, out, ann, is_expanded);
- if is_expanded && !std_inject::injected_crate_name().is_none() {
+ if is_expanded && std_inject::injected_crate_name().is_some() {
// We need to print `#![no_std]` (and its feature gate) so that
// compiling pretty-printed source won't inject libstd again.
// However we don't want these attributes in the AST because
}
pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<&str>) -> ast::Crate {
- let name = if attr::contains_name(&krate.attrs, "no_core") {
+ // the first name in this list is the crate name of the crate with the prelude
+ let names: &[&str] = if attr::contains_name(&krate.attrs, "no_core") {
return krate;
} else if attr::contains_name(&krate.attrs, "no_std") {
- "core"
+ if attr::contains_name(&krate.attrs, "compiler_builtins") {
+ &["core"]
+ } else {
+ &["core", "compiler_builtins"]
+ }
} else {
- "std"
+ &["std"]
};
- INJECTED_CRATE_NAME.with(|opt_name| opt_name.set(Some(name)));
+ for name in names {
+ krate.module.items.insert(0, P(ast::Item {
+ attrs: vec![attr::mk_attr_outer(DUMMY_SP,
+ attr::mk_attr_id(),
+ attr::mk_word_item(ast::Ident::from_str("macro_use")))],
+ vis: dummy_spanned(ast::VisibilityKind::Inherited),
+ node: ast::ItemKind::ExternCrate(alt_std_name.map(Symbol::intern)),
+ ident: ast::Ident::from_str(name),
+ id: ast::DUMMY_NODE_ID,
+ span: DUMMY_SP,
+ tokens: None,
+ }));
+ }
- krate.module.items.insert(0, P(ast::Item {
- attrs: vec![attr::mk_attr_outer(DUMMY_SP,
- attr::mk_attr_id(),
- attr::mk_word_item(ast::Ident::from_str("macro_use")))],
- vis: dummy_spanned(ast::VisibilityKind::Inherited),
- node: ast::ItemKind::ExternCrate(alt_std_name.map(Symbol::intern)),
- ident: ast::Ident::from_str(name),
- id: ast::DUMMY_NODE_ID,
- span: DUMMY_SP,
- tokens: None,
- }));
+ // the crates have been injected, the assumption is that the first one is the one with
+ // the prelude.
+ let name = names[0];
+
+ INJECTED_CRATE_NAME.with(|opt_name| opt_name.set(Some(name)));
let span = ignored_span(DUMMY_SP);
krate.module.items.insert(0, P(ast::Item {
[dependencies]
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
[dependencies]
core = { path = "../../libcore" }
+compiler_builtins = { path = "../../rustc/compiler_builtins_shim" }
alloc = { path = "../../liballoc" }
#
# See https://github.com/rust-lang/rfcs/pull/1133.
core = { path = "../../libcore" }
+compiler_builtins = { path = "../compiler_builtins_shim" }
+
[features]
# Certain parts of libc are conditionally compiled differently than when used