rust/library
Matthias Krüger a6e4d684aa
Rollup merge of #92097 - saethlin:split-without-deref, r=the8472
Implement split_at_spare_mut without Deref to a slice so that the spare slice is valid

~I'm not sure I understand what's going on here correctly. And I'm pretty sure this safety comment needs to be changed. I'm just referring to the same thing that `as_mut_ptr_range` does.~ (Thanks `@RalfJung` for the guidance and clearing things up)

I tried to run https://github.com/rust-lang/miri-test-libstd on alloc with -Zmiri-track-raw-pointers, and got a failure on the test `vec::test_extend_from_within`.

I minimized the test failure into this program:
```rust
#![feature(vec_split_at_spare)]
fn main() {
    Vec::<i32>::with_capacity(1).split_at_spare_mut();
}
```

The problem is that the existing implementation is actually getting a pointer range where both pointers are derived from the initialized region of the Vec's allocation, but we need the second one to be valid for the region between len and capacity. (thanks Ralf for clearing this up)
2022-01-01 10:48:54 +01:00
..
alloc Rollup merge of #92097 - saethlin:split-without-deref, r=the8472 2022-01-01 10:48:54 +01:00
backtrace@b02ed04a7e Updated backtrace submodule 2021-11-02 12:31:34 +01:00
core Use UnsafeCell::get_mut() in core::lazy::OnceCell::get_mut() 2021-12-30 05:04:44 +02:00
panic_abort Stabilize asm! and global_asm! 2021-12-12 11:20:03 +00:00
panic_unwind Fix a bunch of typos 2021-12-14 16:40:43 +01:00
portable-simd Merge commit '533f0fc81ab9ba097779fcd27c8f9ea12261fef5' into psimd 2021-12-17 15:10:53 +08:00
proc_macro made compiler happy 2021-12-14 16:42:16 +05:30
profiler_builtins rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rtstartup Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
rustc-std-workspace-alloc rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-core rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-std rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
std Remove needless allocation from example code of OsString 2021-12-30 12:45:02 -08:00
stdarch@0716b22e90 update stdarch 2021-12-15 10:22:03 +08:00
test Update more rustc/libtest things for wasm64 2021-11-10 08:35:42 -08:00
unwind Android: -ldl must appear after -lgcc when linking 2021-11-30 02:42:35 +00:00