rust/tests
bors dffea43fc1 Auto merge of #106180 - RalfJung:dereferenceable-generators, r=nbdd0121
make &mut !Unpin not dereferenceable, and Box<!Unpin> not noalias

See https://github.com/rust-lang/unsafe-code-guidelines/issues/381 and [this LLVM discussion](https://discourse.llvm.org/t/interaction-of-noalias-and-dereferenceable/66979). The exact semantics of how `noalias` and `dereferenceable` interact are unclear, and `@comex` found a case of LLVM actually exploiting that ambiguity for optimizations. I think for now we should treat LLVM `dereferenceable` as implying a "fake read" to happen immediately at the top of the function (standing in for the spurious reads that LLVM might introduce), and that fake read is subject to all the usual `noalias` restrictions. This means we cannot put `dereferenceable` on `&mut !Unpin` references as those references can alias with other references that are being read and written inside the function (e.g. for self-referential generators), meaning the fake read introduces aliasing conflicts with those other accesses.

For `&` this is already not a problem due to https://github.com/rust-lang/rust/pull/98017 which removed the `dereferenceable` attribute for other reasons.

Regular `&mut Unpin` references are unaffected, so I hope the impact of this is going to be tiny.

The first commit does some refactoring of the `PointerKind` enum since I found the old code very confusing each time I had to touch it. It doesn't change behavior.

Fixes https://github.com/rust-lang/miri/issues/2714

EDIT: Turns out our `Box<!Unpin>` treatment was incorrect, too, so the PR also fixes that now (in codegen and Miri): we do not put `noalias` on these boxes any more.
2023-02-07 03:35:10 +00:00
..
assembly bump failing assembly & codegen tests from LLVM 14 to LLVM 15 2023-01-17 20:02:01 +01:00
auxiliary
codegen also do not add noalias on not-Unpin Box 2023-02-06 12:17:41 +01:00
codegen-units
debuginfo Upgrade mingw-w64 on CI 2023-01-29 13:01:06 +01:00
incremental
mir-opt Bless 32bit tests. 2023-02-05 13:51:37 +00:00
pretty Update tests. 2023-01-29 20:19:26 +01:00
run-make incremental: migrate diagnostics 2023-01-30 17:11:35 +00:00
run-make-fulldeps Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
run-pass-valgrind
rustdoc rustdoc: trait bound formatting 2023-02-04 19:10:04 +01:00
rustdoc-gui Auto merge of #107141 - notriddle:notriddle/max-lev-distance-2023, r=GuillaumeGomez 2023-02-06 02:09:00 +00:00
rustdoc-js rustdoc: update test cases to match with stricter match criteria 2023-01-21 00:11:39 -07:00
rustdoc-js-std rustdoc: add test case based on #103357 2023-01-24 09:49:33 -07:00
rustdoc-json
rustdoc-ui Auto merge of #107000 - GuillaumeGomez:fix-items-in-doc-hidden-block, r=notriddle,petrochenkov 2023-02-02 21:14:44 +00:00
ui Rollup merge of #107692 - Swatinem:printsizeyield, r=compiler-errors 2023-02-06 21:16:41 +01:00
ui-fulldeps Forbid #[suggestion_*(...)] on Vecs 2023-02-01 21:49:45 +01:00
COMPILER_TESTS.md