about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorSamuel E. Moelius III <sam@moeli.us>2022-04-25 05:20:08 -0400
committerSamuel E. Moelius III <sam@moeli.us>2022-04-25 05:20:08 -0400
commite6fa163fad15963be686d2bad121f44c8a407d90 (patch)
treec5f4a54da36a275e43b2388429a5fb1adf31dd94 /tests
parentb35c04f7dc8febef216b17209d030bd239c19f2c (diff)
downloadrust-e6fa163fad15963be686d2bad121f44c8a407d90.tar.gz
rust-e6fa163fad15963be686d2bad121f44c8a407d90.zip
Fix false positives
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/extra_unused_lifetimes.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/extra_unused_lifetimes.rs b/tests/ui/extra_unused_lifetimes.rs
index 69dc2f7965e..f76127a7105 100644
--- a/tests/ui/extra_unused_lifetimes.rs
+++ b/tests/ui/extra_unused_lifetimes.rs
@@ -88,4 +88,30 @@ mod issue6437 {
     }
 }
 
+// https://github.com/rust-lang/rust-clippy/pull/8737#pullrequestreview-951268213
+mod first_case {
+    use serde::de::Visitor;
+    pub trait Expected {
+        fn fmt(&self, formatter: &mut std::fmt::Formatter);
+    }
+
+    impl<'de, T> Expected for T
+    where
+        T: Visitor<'de>,
+    {
+        fn fmt(&self, formatter: &mut std::fmt::Formatter) {}
+    }
+}
+
+// https://github.com/rust-lang/rust-clippy/pull/8737#pullrequestreview-951268213
+mod second_case {
+    pub trait Source {
+        fn hey();
+    }
+
+    impl<'a, T: Source + ?Sized + 'a> Source for Box<T> {
+        fn hey() {}
+    }
+}
+
 fn main() {}