diff --git a/build_sysroot/Cargo.toml b/build_sysroot/Cargo.toml index 3ba06fcb0f6..648a407984c 100644 --- a/build_sysroot/Cargo.toml +++ b/build_sysroot/Cargo.toml @@ -13,6 +13,7 @@ alloc_system = { path = "./alloc_system" } [patch.crates-io] rustc-std-workspace-core = { path = "./sysroot_src/src/tools/rustc-std-workspace-core" } +rustc-std-workspace-alloc = { path = "./rustc-std-workspace-alloc" } compiler_builtins = { path = "./compiler_builtins" } [profile.release] diff --git a/build_sysroot/rustc-std-workspace-alloc/Cargo.toml b/build_sysroot/rustc-std-workspace-alloc/Cargo.toml new file mode 100644 index 00000000000..221365373ff --- /dev/null +++ b/build_sysroot/rustc-std-workspace-alloc/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "rustc-std-workspace-alloc" +version = "1.0.0" +authors = ["Alex Crichton "] +license = 'MIT/Apache-2.0' +description = """ +Hack for the compiler's own build system +""" +edition = "2018" + +[lib] +path = "lib.rs" + +[dependencies] +alloc = { path = "../sysroot_src/src/liballoc" } diff --git a/build_sysroot/rustc-std-workspace-alloc/lib.rs b/build_sysroot/rustc-std-workspace-alloc/lib.rs new file mode 100644 index 00000000000..cf216ec9d29 --- /dev/null +++ b/build_sysroot/rustc-std-workspace-alloc/lib.rs @@ -0,0 +1,5 @@ +#![feature(no_core)] +#![no_core] +#![deny(rust_2018_idioms)] + +pub use ::alloc::*; diff --git a/src/lib.rs b/src/lib.rs index 53dc644ddc4..db73d930665 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -340,13 +340,13 @@ impl CodegenBackend for CraneliftCodegenBackend { } else { None }, - metadata_module: CompiledModule { + metadata_module: Some(CompiledModule { name: "dummy_metadata".to_string(), kind: ModuleKind::Metadata, object: None, bytecode: None, bytecode_compressed: None, - }, + }), crate_hash: tcx.crate_hash(LOCAL_CRATE), metadata, windows_subsystem: None, // Windows is not yet supported