aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/deny_elided_lifetimes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/deny_elided_lifetimes.rs')
-rw-r--r--tests/ui/deny_elided_lifetimes.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/deny_elided_lifetimes.rs b/tests/ui/deny_elided_lifetimes.rs
new file mode 100644
index 00000000..0ab3f750
--- /dev/null
+++ b/tests/ui/deny_elided_lifetimes.rs
@@ -0,0 +1,27 @@
+#![deny(elided_lifetimes_in_paths)]
+
+#[cxx::bridge]
+mod ffi {
+ #[derive(PartialEq, PartialOrd, Hash)]
+ struct Struct<'a> {
+ reference: &'a i32,
+ }
+
+ extern "Rust" {
+ type Rust<'a>;
+ }
+
+ unsafe extern "C++" {
+ type Cpp<'a>;
+
+ fn lifetime_named<'a>(s: &'a i32) -> UniquePtr<Cpp<'a>>;
+
+ fn lifetime_underscore(s: &i32) -> UniquePtr<Cpp<'_>>;
+
+ fn lifetime_elided(s: &i32) -> UniquePtr<Cpp>;
+ }
+}
+
+pub struct Rust<'a>(&'a i32);
+
+fn main() {}