Skip to content

Commit

Permalink
Add alloc and proc_macro to libstd crates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton committed Sep 6, 2019
1 parent 9eaddf5 commit 2ed112c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cargo/core/compiler/standard_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub fn parse_unstable_flag(value: Option<&str>) -> Vec<String> {
let mut crates: HashSet<&str> = value.split(',').collect();
if crates.contains("std") {
crates.insert("core");
crates.insert("alloc");
crates.insert("proc_macro");
crates.insert("panic_unwind");
crates.insert("compiler_builtins");
} else if crates.contains("core") {
Expand Down
10 changes: 9 additions & 1 deletion tests/testsuite/standard_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,15 @@ fn doc() {

fn check_std() {
let p = project()
.file("src/lib.rs", "pub fn f() {}")
.file(
"src/lib.rs",
"
extern crate core;
extern crate alloc;
extern crate proc_macro;
pub fn f() {}
",
)
.file("src/main.rs", "fn main() {}")
.file(
"tests/t1.rs",
Expand Down

0 comments on commit 2ed112c

Please sign in to comment.