]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/variance/constraints.rs
Rollup merge of #101786 - chenyukang:fix-tidy-for-bootstrap, r=jyn514
[rust.git] / compiler / rustc_typeck / src / variance / constraints.rs
index d79450e1ae707c30a171f85ee0277df03aca63bc..eaf0310d57aeca595c744cf9ee437a31610091c1 100644 (file)
@@ -257,7 +257,7 @@ fn add_constraints_from_ty(
                 self.add_constraints_from_invariant_substs(current, substs, variance);
             }
 
-            ty::Dynamic(data, r) => {
+            ty::Dynamic(data, r, _) => {
                 // The type `Foo<T+'a>` is contravariant w/r/t `'a`:
                 let contra = self.contravariant(variance);
                 self.add_constraints_from_region(current, r, contra);
@@ -271,11 +271,11 @@ fn add_constraints_from_ty(
                 }
 
                 for projection in data.projection_bounds() {
-                    match projection.skip_binder().term {
-                        ty::Term::Ty(ty) => {
+                    match projection.skip_binder().term.unpack() {
+                        ty::TermKind::Ty(ty) => {
                             self.add_constraints_from_ty(current, ty, self.invariant);
                         }
-                        ty::Term::Const(c) => {
+                        ty::TermKind::Const(c) => {
                             self.add_constraints_from_const(current, c, self.invariant)
                         }
                     }
@@ -411,11 +411,7 @@ fn add_constraints_from_region(
                 // way early-bound regions do, so we skip them here.
             }
 
-            ty::ReFree(..)
-            | ty::ReVar(..)
-            | ty::RePlaceholder(..)
-            | ty::ReEmpty(_)
-            | ty::ReErased => {
+            ty::ReFree(..) | ty::ReVar(..) | ty::RePlaceholder(..) | ty::ReErased => {
                 // We don't expect to see anything but 'static or bound
                 // regions when visiting member types or method types.
                 bug!(