Skip to content

Commit 5401098

Browse files
authored
Rollup merge of #121441 - lcnr:typesystem-cleanup, r=compiler-errors
`DefId` to `LocalDefId`
2 parents e064bf6 + 7921ce3 commit 5401098

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/rustc_hir_analysis/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ fn adt_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::AdtDef<'_> {
10271027
let repr = if is_anonymous {
10281028
tcx.adt_def(tcx.local_parent(def_id)).repr()
10291029
} else {
1030-
tcx.repr_options_of_def(def_id.to_def_id())
1030+
tcx.repr_options_of_def(def_id)
10311031
};
10321032
let (kind, variants) = match &item.kind {
10331033
ItemKind::Enum(def, _) => {

compiler/rustc_middle/src/ty/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1472,15 +1472,16 @@ impl<'tcx> TyCtxt<'tcx> {
14721472
.filter(move |item| item.kind == AssocKind::Fn && item.defaultness(self).has_value())
14731473
}
14741474

1475-
pub fn repr_options_of_def(self, did: DefId) -> ReprOptions {
1475+
pub fn repr_options_of_def(self, did: LocalDefId) -> ReprOptions {
14761476
let mut flags = ReprFlags::empty();
14771477
let mut size = None;
14781478
let mut max_align: Option<Align> = None;
14791479
let mut min_pack: Option<Align> = None;
14801480

14811481
// Generate a deterministically-derived seed from the item's path hash
14821482
// to allow for cross-crate compilation to actually work
1483-
let mut field_shuffle_seed = self.def_path_hash(did).0.to_smaller_hash().as_u64();
1483+
let mut field_shuffle_seed =
1484+
self.def_path_hash(did.to_def_id()).0.to_smaller_hash().as_u64();
14841485

14851486
// If the user defined a custom seed for layout randomization, xor the item's
14861487
// path hash with the user defined seed, this will allowing determinism while

0 commit comments

Comments
 (0)