Add ui test of invalid use of 'static as lifetime param name

This commit is contained in:
David Tolnay 2021-04-08 18:12:51 -07:00
parent 035d798242
commit d7705ddaad
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
type Logger;
fn logger<'static>() -> Pin<&'static Logger>;
}
}
fn main() {}

View File

@ -0,0 +1,5 @@
error[E0262]: invalid lifetime parameter name: `'static`
--> $DIR/reserved_lifetime.rs:6:19
|
6 | fn logger<'static>() -> Pin<&'static Logger>;
| ^^^^^^^ 'static is a reserved lifetime name