only set noalias on Box with the global allocator
This commit is contained in:
parent
5a1e5449c8
commit
f391c0793b
17 changed files with 75 additions and 28 deletions
|
@ -452,7 +452,7 @@ fn adjust_for_rust_scalar<'tcx>(
|
|||
let no_alias = match kind {
|
||||
PointerKind::SharedRef { frozen } => frozen,
|
||||
PointerKind::MutableRef { unpin } => unpin && noalias_mut_ref,
|
||||
PointerKind::Box { unpin } => unpin && noalias_for_box,
|
||||
PointerKind::Box { unpin, global } => unpin && global && noalias_for_box,
|
||||
};
|
||||
// We can never add `noalias` in return position; that LLVM attribute has some very surprising semantics
|
||||
// (see <https://github.com/rust-lang/unsafe-code-guidelines/issues/385#issuecomment-1368055745>).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue