Remove has_errors from FnCtxt

This commit is contained in:
Michael Goulet 2022-11-02 02:13:27 +00:00
parent c0a7612728
commit 74fec9b95a
6 changed files with 20 additions and 19 deletions

View file

@ -1,6 +1,7 @@
fn main () {
fn main() {
'a: loop {
|| {
//~^ ERROR mismatched types
loop { break 'a; } //~ ERROR E0767
}
}

View file

@ -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]`
For more information about this error, try `rustc --explain E0767`.
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0308, E0767.
For more information about an error, try `rustc --explain E0308`.