-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: recover on
&'lifetime mut $pat
.
- Loading branch information
Showing
6 changed files
with
55 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main() { | ||
let &'a x = &0; //~ ERROR unexpected lifetime `'a` in pattern | ||
let &'a mut y = &mut 0; //~ ERROR unexpected lifetime `'a` in pattern | ||
|
||
let _recovery_witness: () = 0; //~ ERROR mismatched types | ||
} |
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,23 @@ | ||
error: unexpected lifetime `'a` in pattern | ||
--> $DIR/lifetime-in-pattern-recover.rs:2:10 | ||
| | ||
LL | let &'a x = &0; | ||
| ^^ help: remove the lifetime | ||
|
||
error: unexpected lifetime `'a` in pattern | ||
--> $DIR/lifetime-in-pattern-recover.rs:3:10 | ||
| | ||
LL | let &'a mut y = &mut 0; | ||
| ^^ help: remove the lifetime | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/lifetime-in-pattern-recover.rs:5:33 | ||
| | ||
LL | let _recovery_witness: () = 0; | ||
| -- ^ expected `()`, found integer | ||
| | | ||
| expected due to this | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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