diff --git a/alloc_miri_test/Cargo.toml b/alloc_miri_test/Cargo.toml index ac870d2..f9212b8 100644 --- a/alloc_miri_test/Cargo.toml +++ b/alloc_miri_test/Cargo.toml @@ -1,29 +1,18 @@ [package] -name = "alloc_miri_test" +name = "alloc" version = "0.0.0" autotests = false autobenches = false edition = "2021" -[lib] -name = "alloc_miri_test" -path = "../library/alloc/src/lib.rs" - -[features] -# Empty this crate to avoid two copies of liballoc. -# See https://github.com/rust-lang/miri-test-libstd/issues/4. -default = ["miri-test-libstd"] -miri-test-libstd = [] - -[dependencies] -# This lets the crate access the `core` and `alloc` crates. -core = { path = "../fake/core" } -alloc = { path = "../fake/alloc" } - [dev-dependencies] rand = { version = "0.8.5", default-features = false, features = ["alloc"] } rand_xorshift = "0.3.0" [[test]] -name = "collectionstests" +name = "alloc-lib" +path = "../library/alloc/src/lib.rs" + +[[test]] +name = "alloc-tests" path = "../library/alloc/tests/lib.rs" diff --git a/alloc_miri_test/src/lib.rs b/alloc_miri_test/src/lib.rs new file mode 100644 index 0000000..bddf1f0 --- /dev/null +++ b/alloc_miri_test/src/lib.rs @@ -0,0 +1,4 @@ +#![feature(no_core, rustc_private)] +#![no_core] +extern crate alloc as realalloc; +pub use realalloc::*; diff --git a/ci-test.sh b/ci-test.sh index eef415b..f82b635 100644 --- a/ci-test.sh +++ b/ci-test.sh @@ -17,13 +17,13 @@ core) for TARGET in x86_64-unknown-linux-gnu mips-unknown-linux-gnu; do echo "::group::Testing core ($TARGET, no validation, no Stacked Borrows, symbolic alignment)" MIRIFLAGS="$DEFAULTFLAGS -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmiri-symbolic-alignment-check" \ - ./run-test.sh core --target $TARGET --lib --tests \ + ./run-test.sh core --target $TARGET --tests \ -- --skip align \ 2>&1 | ts -i '%.s ' echo "::endgroup::" echo "::group::Testing core ($TARGET)" MIRIFLAGS="$DEFAULTFLAGS" \ - ./run-test.sh core --target $TARGET --lib --tests \ + ./run-test.sh core --target $TARGET --tests \ 2>&1 | ts -i '%.s ' echo "::endgroup::" echo "::group::Testing core docs ($TARGET, ignore leaks)" && echo @@ -39,7 +39,7 @@ alloc) for TARGET in x86_64-unknown-linux-gnu mips-unknown-linux-gnu; do echo "::group::Testing alloc ($TARGET, symbolic alignment)" MIRIFLAGS="$DEFAULTFLAGS -Zmiri-symbolic-alignment-check" \ - ./run-test.sh alloc --target $TARGET --lib --tests \ + ./run-test.sh alloc --target $TARGET --tests \ 2>&1 | ts -i '%.s ' echo "::endgroup::" echo "::group::Testing alloc docs ($TARGET, ignore leaks)" diff --git a/core_miri_test/Cargo.toml b/core_miri_test/Cargo.toml index 3188dea..ae659b8 100644 --- a/core_miri_test/Cargo.toml +++ b/core_miri_test/Cargo.toml @@ -6,26 +6,10 @@ autotests = false autobenches = false edition = "2021" -[lib] -name = "core_miri_test" -path = "../library/core/src/lib.rs" -test = false -bench = false - -[features] -# Empty this crate to avoid two copies of libcore. -# See https://github.com/rust-lang/miri-test-libstd/issues/4. -default = ["miri-test-libstd"] -miri-test-libstd = [] - [[test]] name = "coretests" path = "../library/core/tests/lib.rs" -[dependencies] -# This lets the crate access the `core` crate. -core = { path = "../fake/core" } - [dev-dependencies] rand = { version = "0.8.5", default-features = false } rand_xorshift = { version = "0.3.0", default-features = false } diff --git a/fake/alloc/Cargo.toml b/fake/alloc/Cargo.toml deleted file mode 100644 index e5a5167..0000000 --- a/fake/alloc/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "alloc" -version = "1.99.0" -license = 'MIT OR Apache-2.0' - -[lib] -path = "lib.rs" diff --git a/fake/alloc/lib.rs b/fake/alloc/lib.rs deleted file mode 100644 index c38a8d2..0000000 --- a/fake/alloc/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(no_core)] -#![no_core] - -// See rustc-std-workspace-core for why this crate is needed. - -// Rename the crate to avoid conflicting with the alloc module in liballoc. -extern crate alloc as foo; - -pub use foo::*; diff --git a/fake/core/Cargo.toml b/fake/core/Cargo.toml deleted file mode 100644 index 0848f01..0000000 --- a/fake/core/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "core" -version = "1.99.0" -license = 'MIT OR Apache-2.0' - -[lib] -path = "lib.rs" diff --git a/fake/core/lib.rs b/fake/core/lib.rs deleted file mode 100644 index c6e2665..0000000 --- a/fake/core/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(no_core)] -#![no_core] - -extern crate core; -pub use core::*; diff --git a/std_miri_test/Cargo.toml b/std_miri_test/Cargo.toml index f231dcc..e8523ab 100644 --- a/std_miri_test/Cargo.toml +++ b/std_miri_test/Cargo.toml @@ -17,8 +17,7 @@ path = "../library/std/src/lib.rs" # just a bunch of fake crates that reeexport sysroot crates, so that std's imports work out # (this works because we only build std as a test; the regular crate build is # completely empty thanks to the `miri-test-libstd` feature below) -core = { path = "../fake/core" } -alloc = { path = "../fake/alloc" } +alloc = { path = "../alloc_miri_test" } cfg-if = { path = "../fake/cfg-if" } libc = { path = "../fake/libc" } hashbrown = { path = "../fake/hashbrown" }