rust/library/alloc/src
bors 5958f5e08f Auto merge of #123317 - RalfJung:test-in-miri, r=m-ou-se,saethlin,onur-ozkan
Support running library tests in Miri

This adds a new bootstrap subcommand `./x.py miri` which can test libraries in Miri. This is in preparation for eventually doing that as part of bors CI, but this PR only adds the infrastructure, and doesn't enable it yet.

`@rust-lang/bootstrap` should this be `x.py test --miri library/core` or `x.py miri library/core`? The flag has the advantage that we don't have to copy all the arguments from `Subcommand::Test`. It has the disadvantage that most test steps just ignore `--miri` and still run tests the regular way. For clippy you went the route of making it a separate subcommand. ~~I went with a flag now as that seemed easier, but I can change this.~~ I made it a new subcommand. Note however that the regular cargo invocation would be `cargo miri test ...`, so `x.py` is still going to be different in that the `test` is omitted. That said, we could also make it `./x.py miri-test` to make that difference smaller -- that's in fact more consistent with the internal name of the command when bootstrap invokes cargo.

`@rust-lang/libs` ~~unfortunately this PR does some unholy things to the `lib.rs` files of our library crates.~~
`@m-ou-se` found a way that entirely avoids library-level hacks, except for some new small `lib.miri.rs` files that hopefully you will never have to touch. There's a new hack in cargo-miri but there it is in good company...
2024-04-05 13:17:09 +00:00
..
alloc run alloc benchmarks in Miri and fix UB 2022-11-07 10:34:04 +01:00
boxed library: use addr_of! 2024-02-24 16:02:17 +03:00
collections Auto merge of #122945 - andy-k:sorted-vec-example, r=jhpratt 2024-04-02 03:14:05 +00:00
ffi lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
raw_vec try_with_capacity for RawVec 2024-03-01 18:20:48 +00:00
rc remove redundant imports 2023-12-10 10:56:22 +08:00
slice ignore core, alloc and test tests that require unwinding on panic=abort 2023-06-13 15:53:24 +02:00
sync Fix some Arc allocator leaks 2024-01-28 18:33:34 +01:00
testing Share testing utilities with non-btree test cases 2022-05-02 10:07:50 +02:00
vec Rename reserve_for_push to grow_one and fix comment. 2024-03-28 16:38:01 -07:00
alloc.rs step cfgs 2024-03-20 08:49:13 -04:00
borrow.rs Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
boxed.rs Require DerefPure for patterns 2024-03-25 19:39:45 -04:00
fmt.rs docs: use correct link, use secondary example 2024-02-12 20:17:47 -05:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate 2024-03-29 19:59:46 -04:00
macros.rs Update doc for alloc::format! and core::concat! 2023-09-06 15:11:21 +02:00
raw_vec.rs Rename reserve_for_push to grow_one and fix comment. 2024-03-28 16:38:01 -07:00
rc.rs Require DerefPure for patterns 2024-03-25 19:39:45 -04:00
slice.rs lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
str.rs Export core::str::from_raw_parts{,_mut} into alloc::str and std::str 2024-01-25 18:11:54 -08:00
string.rs doc: mention heap allocation earlier in String docs 2024-04-01 00:04:57 +03:00
sync.rs Require DerefPure for patterns 2024-03-25 19:39:45 -04:00
task.rs lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
tests.rs remove redundant imports 2023-12-10 10:56:22 +08:00