mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-27 01:11:38 +00:00
Add ui test of invalid use of 'static as lifetime param name
This commit is contained in:
parent
035d798242
commit
d7705ddaad
10
tests/ui/reserved_lifetime.rs
Normal file
10
tests/ui/reserved_lifetime.rs
Normal file
@ -0,0 +1,10 @@
|
||||
#[cxx::bridge]
|
||||
mod ffi {
|
||||
unsafe extern "C++" {
|
||||
type Logger;
|
||||
|
||||
fn logger<'static>() -> Pin<&'static Logger>;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
5
tests/ui/reserved_lifetime.stderr
Normal file
5
tests/ui/reserved_lifetime.stderr
Normal 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
|
Loading…
Reference in New Issue
Block a user