about summary refs log tree commit diff
path: root/compiler/rustc_plugin_impl/src
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-03-11 15:32:54 -0800
committerScott McMurray <scottmcm@users.noreply.github.com>2023-03-11 17:44:43 -0800
commitb2c717fa338dd3e917008484c4bf55886041f743 (patch)
treec8c203c011ef038f7a2ddeb0a9c09b760a9def4d /compiler/rustc_plugin_impl/src
parent19c53768af6e48514238e4224b5bf5ecd51bc7b1 (diff)
downloadrust-b2c717fa338dd3e917008484c4bf55886041f743.tar.gz
rust-b2c717fa338dd3e917008484c4bf55886041f743.zip
`MaybeUninit::assume_init_read` should have `noundef` load metadata
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`.
Diffstat (limited to 'compiler/rustc_plugin_impl/src')
0 files changed, 0 insertions, 0 deletions