rust/compiler/rustc_hir_analysis
Scott McMurray b2c717fa33 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`.
2023-03-11 17:44:43 -08:00
..
locales Rollup merge of #108930 - Ezrashaw:better-error-for-manual-fn-impl, r=petrochenkov 2023-03-10 19:59:19 +01:00
src MaybeUninit::assume_init_read should have noundef load metadata 2023-03-11 17:44:43 -08:00
Cargo.toml Use ThinVec in various AST types. 2023-02-21 11:51:56 +11:00
README.md rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.