Skip to content

Commit 1a104ff

Browse files
committed
allow disabling also for const refs
1 parent 28a08d7 commit 1a104ff

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_ty_utils/src

1 file changed

+1
-1
lines changed

compiler/rustc_ty_utils/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ fn adjust_for_rust_scalar<'tcx>(
432432
//
433433
// `&mut T` and `Box<T>` where `T: Unpin` are unique and hence `noalias`.
434434
let no_alias = match kind {
435-
PointerKind::SharedRef { frozen } => frozen,
435+
PointerKind::SharedRef { frozen } => frozen && noalias_mut_ref,
436436
PointerKind::MutableRef { unpin } => unpin && noalias_mut_ref,
437437
PointerKind::Box { unpin, global } => unpin && global && noalias_for_box,
438438
};

0 commit comments

Comments
 (0)