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 {