Win some lose some; Unfortunately we lost recovery in one case.

This commit is contained in:
Mazdak Farrokhzad 2019-07-08 15:35:56 +02:00
parent e3cdadd73f
commit 7c0b1da2c1
2 changed files with 4 additions and 20 deletions

View File

@ -1,12 +1,12 @@
// NOTE: This doesn't recover anymore.
fn main() {
let x = (1, 2, 3, 4);
match x {
(1, .., 4) => {}
(1, .=., 4) => { let _: usize = ""; }
//~^ ERROR expected pattern, found `.`
//~| ERROR mismatched types
(.=., 4) => {}
//~^ ERROR expected pattern, found `.`
(1, 2, 3, 4) => {}
}
}

View File

@ -1,24 +1,8 @@
error: expected pattern, found `.`
--> $DIR/recover-tuple-pat.rs:5:13
--> $DIR/recover-tuple-pat.rs:7:13
|
LL | (1, .=., 4) => { let _: usize = ""; }
| ^ expected pattern
error: expected pattern, found `.`
--> $DIR/recover-tuple-pat.rs:8:10
|
LL | (.=., 4) => {}
| ^ expected pattern
error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/recover-tuple-pat.rs:5:41
|
LL | (1, .=., 4) => { let _: usize = ""; }
| ^^ expected usize, found reference
|
= note: expected type `usize`
found type `&'static str`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.