diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-19 22:45:03 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-28 00:00:33 +0000 |
| commit | eeecb56b7301c1bf1cf221c65e857b756b9ab42b (patch) | |
| tree | 7e1a78351ae65b3385a0bab7b2052368c194e496 /compiler/rustc_codegen_ssa | |
| parent | 057313b7a607513d6c1aa82e454e2370025f3b9a (diff) | |
| download | rust-eeecb56b7301c1bf1cf221c65e857b756b9ab42b.tar.gz rust-eeecb56b7301c1bf1cf221c65e857b756b9ab42b.zip | |
Represent the raw pointer for a array length check as a new kind of fake borrow
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index e775d219c7b..d7fc5e8e673 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -612,9 +612,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { mir::Rvalue::CopyForDeref(place) => { self.codegen_operand(bx, &mir::Operand::Copy(place)) } - mir::Rvalue::RawPtr(mutability, place) => { - let mk_ptr = - move |tcx: TyCtxt<'tcx>, ty: Ty<'tcx>| Ty::new_ptr(tcx, ty, mutability); + mir::Rvalue::RawPtr(kind, place) => { + let mk_ptr = move |tcx: TyCtxt<'tcx>, ty: Ty<'tcx>| { + Ty::new_ptr(tcx, ty, kind.to_mutbl_lossy()) + }; self.codegen_place_to_pointer(bx, place, mk_ptr) } |
