mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Remove a has_errors check that does not prevent follow up error noise
This commit is contained in:
parent
a6b1e433da
commit
28f250d6a6
@ -2641,10 +2641,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
if let Some(e) = self.tainted_by_errors() {
|
||||
return e;
|
||||
}
|
||||
if let Some(e) = self.dcx().has_errors() {
|
||||
// no need to overload user in such cases
|
||||
return e;
|
||||
}
|
||||
let SubtypePredicate { a_is_expected: _, a, b } = data;
|
||||
// both must be type variables, or the other would've been instantiated
|
||||
assert!(a.is_ty_var() && b.is_ty_var());
|
||||
|
@ -8,7 +8,7 @@ error[E0282]: type annotations needed for `Option<T>`
|
||||
--> $DIR/parameter-defaults.rs:13:9
|
||||
|
|
||||
LL | let _ = NONE;
|
||||
| ^
|
||||
| ^ ---- type must be known at this point
|
||||
|
|
||||
help: consider giving this pattern a type, where the type for type parameter `T` is specified
|
||||
|
|
||||
|
@ -1,4 +1,6 @@
|
||||
fn main() {
|
||||
const EMPTY_ARRAY = [];
|
||||
//~^ missing type for `const` item
|
||||
//~| ERROR type annotations needed
|
||||
//~| ERROR type annotations needed
|
||||
}
|
||||
|
@ -1,8 +1,23 @@
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/issue-89574.rs:2:25
|
||||
|
|
||||
LL | const EMPTY_ARRAY = [];
|
||||
| ^^ cannot infer type
|
||||
|
||||
error: missing type for `const` item
|
||||
--> $DIR/issue-89574.rs:2:22
|
||||
|
|
||||
LL | const EMPTY_ARRAY = [];
|
||||
| ^ help: provide a type for the item: `: <type>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/issue-89574.rs:2:25
|
||||
|
|
||||
LL | const EMPTY_ARRAY = [];
|
||||
| ^^ cannot infer type
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0282`.
|
||||
|
@ -41,7 +41,7 @@ error[E0282]: type annotations needed for `Vec<_>`
|
||||
--> $DIR/missing-closing-angle-bracket-eq-constraint.rs:7:7
|
||||
|
|
||||
LL | let v : Vec<(u32,_) = vec![];
|
||||
| ^
|
||||
| ^ ------ type must be known at this point
|
||||
|
|
||||
help: consider giving `v` an explicit type, where the placeholders `_` are specified
|
||||
|
|
||||
@ -52,7 +52,7 @@ error[E0282]: type annotations needed for `Vec<_>`
|
||||
--> $DIR/missing-closing-angle-bracket-eq-constraint.rs:18:7
|
||||
|
|
||||
LL | let v : Vec<'a = vec![];
|
||||
| ^
|
||||
| ^ ------ type must be known at this point
|
||||
|
|
||||
help: consider giving `v` an explicit type, where the placeholders `_` are specified
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user