about summary refs log tree commit diff
path: root/tests/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs')
-rw-r--r--tests/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs b/tests/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs
new file mode 100644
index 00000000000..125a395db3b
--- /dev/null
+++ b/tests/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs
@@ -0,0 +1,17 @@
+// Test that we DO NOT warn for a lifetime used twice in an impl.
+//
+// check-pass
+
+#![deny(single_use_lifetimes)]
+#![allow(dead_code)]
+#![allow(unused_variables)]
+
+struct Foo<'f> {
+    data: &'f u32,
+}
+
+impl<'f> Foo<'f> {
+    fn inherent_a(&self, data: &'f u32) {}
+}
+
+fn main() {}