mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
b2c717fa33
I was looking into `array::IntoIter` optimization, and noticed that it wasn't annotating the loads with `noundef` for simple things like `array::IntoIter<i32, N>`. Turned out to be a more general problem as `MaybeUninit::assume_init_read` isn't marking the load as initialized (<https://rust.godbolt.org/z/Mxd8TPTnv>), which is unfortunate since that's basically its reason to exist. This PR lowers `ptr::read(p)` to `copy *p` in MIR, which fortuitiously also improves the IR we give to LLVM for things like `mem::replace`. |
||
---|---|---|
.. | ||
allowed_slices.rs | ||
forbidden_slices.rs | ||
forbidden_slices.stderr | ||
out_of_bounds_read.rs | ||
out_of_bounds_read.stderr |