Add ui test for disallowed lifetimes

This commit is contained in:
David Tolnay 2020-04-22 16:11:21 -07:00
parent d763f4cd64
commit 6d9f4aab20
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 24 additions and 0 deletions

View 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() {}

View 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);
| ^^^^^^^^^^^^^