UnsafeCell now has no niches, ever.

This commit is contained in:
Oli Scherer
2022-07-07 10:46:22 +00:00
parent e78e747f53
commit 2a899dc1cf
22 changed files with 73 additions and 512 deletions

View File

@@ -96,13 +96,13 @@ impl Qualif for HasMutInterior {
}
fn in_adt_inherently<'tcx>(
cx: &ConstCx<'_, 'tcx>,
_cx: &ConstCx<'_, 'tcx>,
adt: AdtDef<'tcx>,
_: SubstsRef<'tcx>,
) -> bool {
// Exactly one type, `UnsafeCell`, has the `HasMutInterior` qualif inherently.
// It arises structurally for all other types.
Some(adt.did()) == cx.tcx.lang_items().unsafe_cell_type()
adt.is_unsafe_cell()
}
}