summaryrefslogtreecommitdiffstats
path: root/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs')
-rw-r--r--src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs b/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs
new file mode 100644
index 000000000..125a395db
--- /dev/null
+++ b/src/test/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() {}