Use ty::Error
for opaque types with errors in its bounds.
This reduces unhelpful diagnostics down the road.
This commit is contained in:
parent
34de78fd81
commit
b952ada0ae
7 changed files with 10 additions and 38 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue