]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/error_reporting/mod.rs
even more unify Projection/Opaque in outlives code
[rust.git] / compiler / rustc_infer / src / infer / error_reporting / mod.rs
index 9c38eb6163f5627043746c3ead3953d998efe121..28fd03b878b2b69b2da3ef46b59a09823f1ea5f3 100644 (file)
@@ -2272,13 +2272,10 @@ pub fn construct_generic_bound_failure(
 
         let labeled_user_string = match bound_kind {
             GenericKind::Param(ref p) => format!("the parameter type `{}`", p),
-            GenericKind::Alias(ty::Projection, ref p) => format!("the associated type `{}`", p),
-            GenericKind::Alias(ty::Opaque, ref p) => {
-                format!(
-                    "the opaque type `{}`",
-                    self.tcx.def_path_str_with_substs(p.def_id, p.substs)
-                )
-            }
+            GenericKind::Alias(ref p) => match p.kind(self.tcx) {
+                ty::AliasKind::Projection => format!("the associated type `{}`", p),
+                ty::AliasKind::Opaque => format!("the opaque type `{}`", p),
+            },
         };
 
         if let Some(SubregionOrigin::CompareImplItemObligation {