Skip to content

Commit 2ed112c

Browse files
committed
Add alloc and proc_macro to libstd crates
These two have been stabilized for all targets like `std` so if `std` is requested let's be sure to make them available to other crates as well.
1 parent 9eaddf5 commit 2ed112c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/cargo/core/compiler/standard_lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub fn parse_unstable_flag(value: Option<&str>) -> Vec<String> {
1717
let mut crates: HashSet<&str> = value.split(',').collect();
1818
if crates.contains("std") {
1919
crates.insert("core");
20+
crates.insert("alloc");
21+
crates.insert("proc_macro");
2022
crates.insert("panic_unwind");
2123
crates.insert("compiler_builtins");
2224
} else if crates.contains("core") {

tests/testsuite/standard_lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,15 @@ fn doc() {
237237

238238
fn check_std() {
239239
let p = project()
240-
.file("src/lib.rs", "pub fn f() {}")
240+
.file(
241+
"src/lib.rs",
242+
"
243+
extern crate core;
244+
extern crate alloc;
245+
extern crate proc_macro;
246+
pub fn f() {}
247+
",
248+
)
241249
.file("src/main.rs", "fn main() {}")
242250
.file(
243251
"tests/t1.rs",

0 commit comments

Comments
 (0)