1
Fork 0

s/mt/mutability/

This commit is contained in:
Oli Scherer 2024-03-11 17:33:57 +00:00
parent d3514a036d
commit 926bfe5078
11 changed files with 28 additions and 21 deletions

View file

@ -102,7 +102,7 @@ fn intern_as_new_static<'tcx>(
let feed = tcx.create_def(
static_id,
sym::nested,
DefKind::Static { mt: alloc.0.mutability, nested: true },
DefKind::Static { mutability: alloc.0.mutability, nested: true },
);
tcx.set_nested_alloc_id_static(alloc_id, feed.def_id());
feed.codegen_fn_attrs(tcx.codegen_fn_attrs(static_id).clone());

View file

@ -484,11 +484,11 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
// Return alloc mutability. For "root" statics we look at the type to account for interior
// mutability; for nested statics we have no type and directly use the annotated mutability.
match self.ecx.tcx.def_kind(did) {
DefKind::Static { mt: Mutability::Mut, .. } => Mutability::Mut,
DefKind::Static { mt: Mutability::Not, nested: true } => {
DefKind::Static { mutability: Mutability::Mut, .. } => Mutability::Mut,
DefKind::Static { mutability: Mutability::Not, nested: true } => {
Mutability::Not
}
DefKind::Static { mt: Mutability::Not, nested: false }
DefKind::Static { mutability: Mutability::Not, nested: false }
if !self
.ecx
.tcx