rename PointerKind::Shared → SharedMutable to indicate this is NOT the usual shared reference
This commit is contained in:
parent
22d25f21dc
commit
307e80c1a6
2 changed files with 5 additions and 5 deletions
|
@ -2618,14 +2618,14 @@ where
|
||||||
// Use conservative pointer kind if not optimizing. This saves us the
|
// Use conservative pointer kind if not optimizing. This saves us the
|
||||||
// Freeze/Unpin queries, and can save time in the codegen backend (noalias
|
// Freeze/Unpin queries, and can save time in the codegen backend (noalias
|
||||||
// attributes in LLVM have compile-time cost even in unoptimized builds).
|
// attributes in LLVM have compile-time cost even in unoptimized builds).
|
||||||
PointerKind::Shared
|
PointerKind::SharedMutable
|
||||||
} else {
|
} else {
|
||||||
match mt {
|
match mt {
|
||||||
hir::Mutability::Not => {
|
hir::Mutability::Not => {
|
||||||
if ty.is_freeze(tcx.at(DUMMY_SP), cx.param_env()) {
|
if ty.is_freeze(tcx.at(DUMMY_SP), cx.param_env()) {
|
||||||
PointerKind::Frozen
|
PointerKind::Frozen
|
||||||
} else {
|
} else {
|
||||||
PointerKind::Shared
|
PointerKind::SharedMutable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hir::Mutability::Mut => {
|
hir::Mutability::Mut => {
|
||||||
|
@ -2636,7 +2636,7 @@ where
|
||||||
if ty.is_unpin(tcx.at(DUMMY_SP), cx.param_env()) {
|
if ty.is_unpin(tcx.at(DUMMY_SP), cx.param_env()) {
|
||||||
PointerKind::UniqueBorrowed
|
PointerKind::UniqueBorrowed
|
||||||
} else {
|
} else {
|
||||||
PointerKind::Shared
|
PointerKind::SharedMutable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3285,7 +3285,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
||||||
// or not to actually emit the attribute. It can also be controlled with the
|
// or not to actually emit the attribute. It can also be controlled with the
|
||||||
// `-Zmutable-noalias` debugging option.
|
// `-Zmutable-noalias` debugging option.
|
||||||
let no_alias = match kind {
|
let no_alias = match kind {
|
||||||
PointerKind::Shared | PointerKind::UniqueBorrowed => false,
|
PointerKind::SharedMutable | PointerKind::UniqueBorrowed => false,
|
||||||
PointerKind::UniqueOwned => noalias_for_box,
|
PointerKind::UniqueOwned => noalias_for_box,
|
||||||
PointerKind::Frozen => !is_return,
|
PointerKind::Frozen => !is_return,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1350,7 +1350,7 @@ impl<'a, Ty> Deref for TyAndLayout<'a, Ty> {
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum PointerKind {
|
pub enum PointerKind {
|
||||||
/// Most general case, we know no restrictions to tell LLVM.
|
/// Most general case, we know no restrictions to tell LLVM.
|
||||||
Shared,
|
SharedMutable,
|
||||||
|
|
||||||
/// `&T` where `T` contains no `UnsafeCell`, is `noalias` and `readonly`.
|
/// `&T` where `T` contains no `UnsafeCell`, is `noalias` and `readonly`.
|
||||||
Frozen,
|
Frozen,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue