mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-24 10:03:39 +00:00
Add ui test for disallowed lifetimes
This commit is contained in:
parent
d763f4cd64
commit
6d9f4aab20
13
tests/ui/disallow_lifetime.rs
Normal file
13
tests/ui/disallow_lifetime.rs
Normal file
@ -0,0 +1,13 @@
|
||||
#[cxx::bridge]
|
||||
mod ffi {
|
||||
extern "C" {
|
||||
type C;
|
||||
fn f(&'static self);
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
fn f(string: &'a String);
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
11
tests/ui/disallow_lifetime.stderr
Normal file
11
tests/ui/disallow_lifetime.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error: references with explicit lifetimes are not supported
|
||||
--> $DIR/disallow_lifetime.rs:9:22
|
||||
|
|
||||
9 | fn f(string: &'a String);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: references with explicit lifetimes are not supported
|
||||
--> $DIR/disallow_lifetime.rs:5:14
|
||||
|
|
||||
5 | fn f(&'static self);
|
||||
| ^^^^^^^^^^^^^
|
Loading…
x
Reference in New Issue
Block a user