Don't point at Self type if we can't find an infer variable in ambiguous trait predicate
This commit is contained in:
@@ -914,9 +914,17 @@ impl<'tcx> Term<'tcx> {
|
||||
pub fn ty(&self) -> Option<Ty<'tcx>> {
|
||||
if let Term::Ty(ty) = self { Some(*ty) } else { None }
|
||||
}
|
||||
|
||||
pub fn ct(&self) -> Option<Const<'tcx>> {
|
||||
if let Term::Const(c) = self { Some(*c) } else { None }
|
||||
}
|
||||
|
||||
pub fn into_arg(self) -> GenericArg<'tcx> {
|
||||
match self {
|
||||
Term::Ty(ty) => ty.into(),
|
||||
Term::Const(c) => c.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// This kind of predicate has no *direct* correspondent in the
|
||||
|
||||
Reference in New Issue
Block a user