about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/fast_reject.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-03-21 17:33:10 -0400
committerMichael Goulet <michael@errs.io>2024-03-22 11:13:29 -0400
commit7be0dbe77292de955da02fe1de1626bdd2e4cc0a (patch)
treebe790699979e783668fcaca21d48c6982983b13e /compiler/rustc_middle/src/ty/fast_reject.rs
parentff0c31e6b9bc8e847c3b1b9d61793325edfacf47 (diff)
downloadrust-7be0dbe77292de955da02fe1de1626bdd2e4cc0a.tar.gz
rust-7be0dbe77292de955da02fe1de1626bdd2e4cc0a.zip
Make RawPtr take Ty and Mutbl separately
Diffstat (limited to 'compiler/rustc_middle/src/ty/fast_reject.rs')
-rw-r--r--compiler/rustc_middle/src/ty/fast_reject.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/fast_reject.rs b/compiler/rustc_middle/src/ty/fast_reject.rs
index adc153c4dfd..5b257cdfd86 100644
--- a/compiler/rustc_middle/src/ty/fast_reject.rs
+++ b/compiler/rustc_middle/src/ty/fast_reject.rs
@@ -120,7 +120,7 @@ pub fn simplify_type<'tcx>(
         ty::Str => Some(SimplifiedType::Str),
         ty::Array(..) => Some(SimplifiedType::Array),
         ty::Slice(..) => Some(SimplifiedType::Slice),
-        ty::RawPtr(ptr) => Some(SimplifiedType::Ptr(ptr.mutbl)),
+        ty::RawPtr(_, mutbl) => Some(SimplifiedType::Ptr(mutbl)),
         ty::Dynamic(trait_info, ..) => match trait_info.principal_def_id() {
             Some(principal_def_id) if !tcx.trait_is_auto(principal_def_id) => {
                 Some(SimplifiedType::Trait(principal_def_id))
@@ -286,8 +286,10 @@ impl DeepRejectCtxt {
                 }
                 _ => false,
             },
-            ty::RawPtr(obl) => match k {
-                ty::RawPtr(imp) => obl.mutbl == imp.mutbl && self.types_may_unify(obl.ty, imp.ty),
+            ty::RawPtr(obl_ty, obl_mutbl) => match *k {
+                ty::RawPtr(imp_ty, imp_mutbl) => {
+                    obl_mutbl == imp_mutbl && self.types_may_unify(obl_ty, imp_ty)
+                }
                 _ => false,
             },
             ty::Dynamic(obl_preds, ..) => {