about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-22 18:09:55 +0100
committerGitHub <noreply@github.com>2024-02-22 18:09:55 +0100
commit5401098eadcfdbbdf2ada74495f1c70da905432d (patch)
tree5e7afaf9fb015ed4dd243cf4f7dca8f252fd0754
parente064bf639b160216cae3c0ae61574abf57993e9a (diff)
parent7921ce3dd3a7c68674594547953592e767b7ed49 (diff)
downloadrust-5401098eadcfdbbdf2ada74495f1c70da905432d.tar.gz
rust-5401098eadcfdbbdf2ada74495f1c70da905432d.zip
Rollup merge of #121441 - lcnr:typesystem-cleanup, r=compiler-errors
`DefId`  to `LocalDefId`
-rw-r--r--compiler/rustc_hir_analysis/src/collect.rs2
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs
index 6a42fdb1079..642009dfa48 100644
--- a/compiler/rustc_hir_analysis/src/collect.rs
+++ b/compiler/rustc_hir_analysis/src/collect.rs
@@ -1027,7 +1027,7 @@ fn adt_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::AdtDef<'_> {
     let repr = if is_anonymous {
         tcx.adt_def(tcx.local_parent(def_id)).repr()
     } else {
-        tcx.repr_options_of_def(def_id.to_def_id())
+        tcx.repr_options_of_def(def_id)
     };
     let (kind, variants) = match &item.kind {
         ItemKind::Enum(def, _) => {
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 6c7ed14f5f1..30409e990e1 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -1472,7 +1472,7 @@ impl<'tcx> TyCtxt<'tcx> {
             .filter(move |item| item.kind == AssocKind::Fn && item.defaultness(self).has_value())
     }
 
-    pub fn repr_options_of_def(self, did: DefId) -> ReprOptions {
+    pub fn repr_options_of_def(self, did: LocalDefId) -> ReprOptions {
         let mut flags = ReprFlags::empty();
         let mut size = None;
         let mut max_align: Option<Align> = None;
@@ -1480,7 +1480,8 @@ impl<'tcx> TyCtxt<'tcx> {
 
         // Generate a deterministically-derived seed from the item's path hash
         // to allow for cross-crate compilation to actually work
-        let mut field_shuffle_seed = self.def_path_hash(did).0.to_smaller_hash().as_u64();
+        let mut field_shuffle_seed =
+            self.def_path_hash(did.to_def_id()).0.to_smaller_hash().as_u64();
 
         // If the user defined a custom seed for layout randomization, xor the item's
         // path hash with the user defined seed, this will allowing determinism while