1
Fork 0

Use ty::Error for opaque types with errors in its bounds.

This reduces unhelpful diagnostics down the road.
This commit is contained in:
Oli Scherer 2021-08-10 15:24:48 +00:00 committed by Oli Scherer
parent 34de78fd81
commit b952ada0ae
7 changed files with 10 additions and 38 deletions

View file

@ -1022,7 +1022,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
if let ty::PredicateKind::Projection(projection) = predicate.kind().skip_binder() {
if projection.ty.references_error() {
// No point on adding these obligations since there's a type error involved.
return ty_var;
return tcx.ty_error();
}
}
// Change the predicate to refer to the type variable,