Remove a has_errors check that doesn't actually prevent noisy follow up errors
This commit is contained in:
parent
28f250d6a6
commit
d31905c904
@ -2720,10 +2720,6 @@ fn maybe_report_ambiguity(&self, obligation: &PredicateObligation<'tcx>) -> Erro
|
|||||||
if let Some(e) = self.tainted_by_errors() {
|
if let Some(e) = self.tainted_by_errors() {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
if let Some(e) = self.dcx().has_errors() {
|
|
||||||
// no need to overload user in such cases
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
struct_span_code_err!(
|
struct_span_code_err!(
|
||||||
self.dcx(),
|
self.dcx(),
|
||||||
span,
|
span,
|
||||||
|
@ -14,6 +14,7 @@ impl<T> Default for T {
|
|||||||
default type Id = T; //~ ERROR type annotations needed
|
default type Id = T; //~ ERROR type annotations needed
|
||||||
// This will be fixed by #111994
|
// This will be fixed by #111994
|
||||||
fn intu(&self) -> &Self::Id {
|
fn intu(&self) -> &Self::Id {
|
||||||
|
//~^ ERROR type annotations needed
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,19 @@ LL | #![feature(specialization)]
|
|||||||
|
|
||||||
error: cannot normalize `<T as Default>::Id`
|
error: cannot normalize `<T as Default>::Id`
|
||||||
|
|
||||||
|
error[E0284]: type annotations needed: cannot satisfy `<T as Default>::Id == _`
|
||||||
|
--> $DIR/specialization-transmute.rs:16:23
|
||||||
|
|
|
||||||
|
LL | fn intu(&self) -> &Self::Id {
|
||||||
|
| ^^^^^^^^^ cannot satisfy `<T as Default>::Id == _`
|
||||||
|
|
||||||
error[E0282]: type annotations needed
|
error[E0282]: type annotations needed
|
||||||
--> $DIR/specialization-transmute.rs:14:23
|
--> $DIR/specialization-transmute.rs:14:23
|
||||||
|
|
|
|
||||||
LL | default type Id = T;
|
LL | default type Id = T;
|
||||||
| ^ cannot infer type for associated type `<T as Default>::Id`
|
| ^ cannot infer type for associated type `<T as Default>::Id`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors; 1 warning emitted
|
error: aborting due to 3 previous errors; 1 warning emitted
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0282`.
|
Some errors have detailed explanations: E0282, E0284.
|
||||||
|
For more information about an error, try `rustc --explain E0282`.
|
||||||
|
Loading…
Reference in New Issue
Block a user