rust/compiler/rustc_mir_build/src
Matthias Krüger 21ddd7ab89
Rollup merge of #135748 - compiler-errors:len-2, r=RalfJung,oli-obk
Lower index bounds checking to `PtrMetadata`, this time with the right fake borrow semantics 😸

Change `Rvalue::RawRef` to take a `RawRefKind` instead of just a `Mutability`. Then introduce `RawRefKind::FakeForPtrMetadata` and use that for lowering index bounds checking to a `PtrMetadata`. This new `RawRefKind::FakeForPtrMetadata` acts like a shallow fake borrow in borrowck, which mimics the semantics of the old `Rvalue::Len` operation we're replacing.

We can then use this `RawRefKind` instead of using a span desugaring hack in CTFE.

cc ``@scottmcm`` ``@RalfJung``
2025-01-28 14:23:22 +01:00
..
builder Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00
thir Use identifiers in diagnostics more often 2025-01-27 01:23:34 +00:00
check_tail_calls.rs Fix typos 2024-12-27 21:35:57 +08:00
check_unsafety.rs Run clippy --fix for unnecessary_map_or lint 2025-01-19 19:15:00 +00:00
errors.rs Use identifiers in diagnostics more often 2025-01-27 01:23:34 +00:00
lib.rs Consolidate ad-hoc MIR lints into real pass-manager-based MIR lints 2025-01-18 21:25:47 +00:00