From 1a104ff8591a508ef7a1dbd07ec641e94efc39d7 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Sat, 9 Nov 2024 02:07:46 -0500 Subject: [PATCH] allow disabling also for const refs --- compiler/rustc_ty_utils/src/abi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index 48149a08de88..87e7560577a5 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -432,7 +432,7 @@ fn adjust_for_rust_scalar<'tcx>( // // `&mut T` and `Box` where `T: Unpin` are unique and hence `noalias`. let no_alias = match kind { - PointerKind::SharedRef { frozen } => frozen, + PointerKind::SharedRef { frozen } => frozen && noalias_mut_ref, PointerKind::MutableRef { unpin } => unpin && noalias_mut_ref, PointerKind::Box { unpin, global } => unpin && global && noalias_for_box, };