only downgrade Error -> Ambiguous if type error is in predicate
This commit is contained in:
parent
8f36334ca9
commit
7bd22e29d0
5 changed files with 25 additions and 27 deletions
|
@ -231,8 +231,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
// `Err(Unimplemented)` to `Ok(None)`. This helps us avoid
|
||||
// emitting additional spurious errors, since we're guaranteed
|
||||
// to have emitted at least one.
|
||||
if stack.obligation.references_error() {
|
||||
debug!("no results for error type, treating as ambiguous");
|
||||
if stack.obligation.predicate.references_error() {
|
||||
debug!(?stack.obligation.predicate, "found error type in predicate, treating as ambiguous");
|
||||
return Ok(None);
|
||||
}
|
||||
return Err(Unimplemented);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue