mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add test raw-underscore-lifetime.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// This test is to ensure that the raw underscore lifetime won't emit two duplicate errors.
|
||||
// See issue #143152
|
||||
|
||||
//@ edition: 2021
|
||||
|
||||
fn f<'r#_>(){}
|
||||
//~^ ERROR `_` cannot be a raw lifetime
|
||||
//~| ERROR `'_` cannot be used here [E0637]
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,15 @@
|
||||
error: `_` cannot be a raw lifetime
|
||||
--> $DIR/raw-underscore-lifetime.rs:6:6
|
||||
|
|
||||
LL | fn f<'r#_>(){}
|
||||
| ^^^^
|
||||
|
||||
error[E0637]: `'_` cannot be used here
|
||||
--> $DIR/raw-underscore-lifetime.rs:6:6
|
||||
|
|
||||
LL | fn f<'r#_>(){}
|
||||
| ^^^^ `'_` is a reserved lifetime name
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0637`.
|
||||
Reference in New Issue
Block a user