rust/compiler/rustc_middle/src/mir
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
..
interpret Also generate undef scalars and scalar pairs 2025-01-21 08:22:15 +00:00
basic_blocks.rs Remove Engine::new_gen_kill. 2024-10-14 16:35:28 +11:00
consts.rs Get rid of mir::Const::from_ty_const 2025-01-20 04:26:44 +00:00
coverage.rs Exclude mir::coverage types from TypeFoldable/TypeVisitable 2025-01-24 16:06:18 +11:00
generic_graph.rs Add warn(unreachable_pub) to rustc_middle. 2024-08-29 20:13:06 +10:00
generic_graphviz.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
graphviz.rs tcx.is_const_fn doesn't work the way it is described, remove it 2024-10-25 20:52:39 +02:00
mod.rs Exclude mir::coverage types from TypeFoldable/TypeVisitable 2025-01-24 16:06:18 +11:00
mono.rs Auto merge of #133929 - saethlin:remove-inline-in-all-cgus, r=nnethercote 2025-01-28 09:43:03 +00:00
patch.rs Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
pretty.rs extract principal MIR dump function 2025-01-25 07:32:20 +00:00
query.rs use fmt::from_fn in more places, instead of using structs that impl formatting traits 2025-01-24 14:45:56 +00:00
statement.rs Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper" 2025-01-18 22:09:34 +00:00
syntax.rs Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00
tcx.rs Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00
terminator.rs fix terminator edges comments 2025-01-25 07:32:20 +00:00
traversal.rs rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00
type_foldable.rs Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00
visit.rs Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00