about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/coherence/builtin.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-03-13 18:05:00 +0000
committerMichael Goulet <michael@errs.io>2025-03-15 06:42:48 +0000
commitb88f85a4106ca0a53a1dab6d605cf56a0cc945ac (patch)
tree74a1d91dcf4a109c1d9b897bf9ca5e184d4bc573 /compiler/rustc_hir_analysis/src/coherence/builtin.rs
parent19c84c8812adb7fa0e7540b5de2541a5995e901a (diff)
downloadrust-b88f85a4106ca0a53a1dab6d605cf56a0cc945ac.tar.gz
rust-b88f85a4106ca0a53a1dab6d605cf56a0cc945ac.zip
Stop relying on rustc_type_ir in non-type-system crates
Diffstat (limited to 'compiler/rustc_hir_analysis/src/coherence/builtin.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/builtin.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
index c918abe4c07..1f3f0b754bb 100644
--- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
@@ -250,13 +250,16 @@ fn visit_implementation_of_dispatch_from_dyn(checker: &Checker<'_>) -> Result<()
     // trait, they *do* satisfy the repr(transparent) rules, and then we assume that everything else
     // in the compiler (in particular, all the call ABI logic) will treat them as repr(transparent)
     // even if they do not carry that attribute.
-    use rustc_type_ir::TyKind::*;
     match (source.kind(), target.kind()) {
-        (&Ref(r_a, _, mutbl_a), Ref(r_b, _, mutbl_b)) if r_a == *r_b && mutbl_a == *mutbl_b => {
+        (&ty::Ref(r_a, _, mutbl_a), ty::Ref(r_b, _, mutbl_b))
+            if r_a == *r_b && mutbl_a == *mutbl_b =>
+        {
             Ok(())
         }
-        (&RawPtr(_, a_mutbl), &RawPtr(_, b_mutbl)) if a_mutbl == b_mutbl => Ok(()),
-        (&Adt(def_a, args_a), &Adt(def_b, args_b)) if def_a.is_struct() && def_b.is_struct() => {
+        (&ty::RawPtr(_, a_mutbl), &ty::RawPtr(_, b_mutbl)) if a_mutbl == b_mutbl => Ok(()),
+        (&ty::Adt(def_a, args_a), &ty::Adt(def_b, args_b))
+            if def_a.is_struct() && def_b.is_struct() =>
+        {
             if def_a != def_b {
                 let source_path = tcx.def_path_str(def_a.did());
                 let target_path = tcx.def_path_str(def_b.did());