diff options
| author | bors <bors@rust-lang.org> | 2024-02-11 04:24:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-11 04:24:40 +0000 |
| commit | 9aa232ecc7bb006a1fad404f437b049482021a3a (patch) | |
| tree | a6466fba328f53939cfa4b2b2848311363ec1a5e /compiler/rustc_const_eval | |
| parent | 0cbef48150e1fab161b5fd147b57ceb3f9272a52 (diff) | |
| parent | 7a6b00e786cf0b245f95a86123ef8130fa159523 (diff) | |
| download | rust-9aa232ecc7bb006a1fad404f437b049482021a3a.tar.gz rust-9aa232ecc7bb006a1fad404f437b049482021a3a.zip | |
Auto merge of #120405 - cjgillot:gvn-pointer, r=oli-obk
Fold pointer operations in GVN This PR proposes 2 combinations of cast operations in MIR GVN: - a chain of `PtrToPtr` or `MutToConstPointer` casts can be folded together into a single `PtrToPtr` cast; - we attempt to evaluate more ptr ops when there is no provenance. In particular, this allows to read from static slices. This is not yet sufficient to see through slice operations that use `PtrComponents` (because that's a union), but still a step forward. r? `@ghost`
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/cast.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index 0cb5c634b22..6d470ff162e 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -415,7 +415,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } } - fn unsize_into( + pub fn unsize_into( &mut self, src: &OpTy<'tcx, M::Provenance>, cast_ty: TyAndLayout<'tcx>, |
