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#71557 - matthewjasper:mir-asymmetric-or-pat…
…tern, r=oli-obk Fix ICE for broken or-pattern in async fn closes rust-lang#71297
- Loading branch information
Showing
6 changed files
with
102 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Regression test for #71297 | ||
// edition:2018 | ||
|
||
#![feature(or_patterns)] | ||
|
||
async fn a((x | s): String) {} | ||
//~^ ERROR variable `x` is not bound in all patterns | ||
//~| ERROR variable `s` is not bound in all patterns | ||
|
||
async fn b() { | ||
let x | s = String::new(); | ||
//~^ ERROR variable `x` is not bound in all patterns | ||
//~| ERROR variable `s` is not bound in all patterns | ||
} | ||
|
||
fn main() {} |
35 changes: 35 additions & 0 deletions
35
src/test/ui/or-patterns/mismatched-bindings-async-fn.stderr
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
error[E0408]: variable `x` is not bound in all patterns | ||
--> $DIR/mismatched-bindings-async-fn.rs:6:17 | ||
| | ||
LL | async fn a((x | s): String) {} | ||
| - ^ pattern doesn't bind `x` | ||
| | | ||
| variable not in all patterns | ||
|
||
error[E0408]: variable `s` is not bound in all patterns | ||
--> $DIR/mismatched-bindings-async-fn.rs:6:13 | ||
| | ||
LL | async fn a((x | s): String) {} | ||
| ^ - variable not in all patterns | ||
| | | ||
| pattern doesn't bind `s` | ||
|
||
error[E0408]: variable `x` is not bound in all patterns | ||
--> $DIR/mismatched-bindings-async-fn.rs:11:13 | ||
| | ||
LL | let x | s = String::new(); | ||
| - ^ pattern doesn't bind `x` | ||
| | | ||
| variable not in all patterns | ||
|
||
error[E0408]: variable `s` is not bound in all patterns | ||
--> $DIR/mismatched-bindings-async-fn.rs:11:9 | ||
| | ||
LL | let x | s = String::new(); | ||
| ^ - variable not in all patterns | ||
| | | ||
| pattern doesn't bind `s` | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0408`. |