Skip to content

Commit 307e80c

Browse files
committed
rename PointerKind::Shared → SharedMutable to indicate this is NOT the usual shared reference
1 parent 22d25f2 commit 307e80c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,14 +2618,14 @@ where
26182618
// Use conservative pointer kind if not optimizing. This saves us the
26192619
// Freeze/Unpin queries, and can save time in the codegen backend (noalias
26202620
// attributes in LLVM have compile-time cost even in unoptimized builds).
2621-
PointerKind::Shared
2621+
PointerKind::SharedMutable
26222622
} else {
26232623
match mt {
26242624
hir::Mutability::Not => {
26252625
if ty.is_freeze(tcx.at(DUMMY_SP), cx.param_env()) {
26262626
PointerKind::Frozen
26272627
} else {
2628-
PointerKind::Shared
2628+
PointerKind::SharedMutable
26292629
}
26302630
}
26312631
hir::Mutability::Mut => {
@@ -2636,7 +2636,7 @@ where
26362636
if ty.is_unpin(tcx.at(DUMMY_SP), cx.param_env()) {
26372637
PointerKind::UniqueBorrowed
26382638
} else {
2639-
PointerKind::Shared
2639+
PointerKind::SharedMutable
26402640
}
26412641
}
26422642
}
@@ -3285,7 +3285,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
32853285
// or not to actually emit the attribute. It can also be controlled with the
32863286
// `-Zmutable-noalias` debugging option.
32873287
let no_alias = match kind {
3288-
PointerKind::Shared | PointerKind::UniqueBorrowed => false,
3288+
PointerKind::SharedMutable | PointerKind::UniqueBorrowed => false,
32893289
PointerKind::UniqueOwned => noalias_for_box,
32903290
PointerKind::Frozen => !is_return,
32913291
};

compiler/rustc_target/src/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ impl<'a, Ty> Deref for TyAndLayout<'a, Ty> {
13501350
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
13511351
pub enum PointerKind {
13521352
/// Most general case, we know no restrictions to tell LLVM.
1353-
Shared,
1353+
SharedMutable,
13541354

13551355
/// `&T` where `T` contains no `UnsafeCell`, is `noalias` and `readonly`.
13561356
Frozen,

0 commit comments

Comments
 (0)