forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#103867 - compiler-errors:no-has-errors, r=c…
…jgillot Remove `has_errors` from `FnCtxt` It doesn't seem like this `has_errors` flag actually suppresses any errors (at least in the UI test suite) --- except for one test (`E0767.rs`), and I think that error really should be considered legitimate, since it has nothing to do with the error code and continues to exist after you fix the first error... This flag was added by `@eddyb` in 6b3cc0b, and it's likely that it was made redundant due to subsequent restructuring of the compiler. It only affects block type-checking anyways, so its effect does seem limited these days anyway.
- Loading branch information
Showing
6 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
fn main () { | ||
fn main() { | ||
'a: loop { | ||
|| { | ||
//~^ ERROR mismatched types | ||
loop { break 'a; } //~ ERROR E0767 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
error[E0767]: use of unreachable label `'a` | ||
--> $DIR/E0767.rs:4:26 | ||
--> $DIR/E0767.rs:5:26 | ||
| | ||
LL | 'a: loop { | ||
| -- unreachable label defined here | ||
LL | || { | ||
... | ||
LL | loop { break 'a; } | ||
| ^^ unreachable label `'a` | ||
| | ||
= note: labels are unreachable through functions, closures, async blocks and modules | ||
|
||
error: aborting due to previous error | ||
error[E0308]: mismatched types | ||
--> $DIR/E0767.rs:3:9 | ||
| | ||
LL | / || { | ||
LL | | | ||
LL | | loop { break 'a; } | ||
LL | | } | ||
| |_________^ expected `()`, found closure | ||
| | ||
= note: expected unit type `()` | ||
found closure `[closure@$DIR/E0767.rs:3:9: 3:11]` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0767`. | ||
Some errors have detailed explanations: E0308, E0767. | ||
For more information about an error, try `rustc --explain E0308`. |