about summary refs log tree commit diff
path: root/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed')
-rw-r--r--src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
index 45e6cfdb821..c568738d94b 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
@@ -78,14 +78,35 @@ mod ban {
     trait MyTrait {
         fn use_self(&self) -> &() { panic!() }
     }
-    trait Irrelevant {}
+    trait Irrelevant {
+        fn use_self(&self) -> &() { panic!() }
+    }
 
     impl MyTrait for dyn ObjectTrait + '_ {}
-    impl Irrelevant for dyn ObjectTrait {}
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
         val.use_self() //~ ERROR E0759
     }
 }
 
+mod bal {
+    trait OtherTrait<'a> {}
+    impl<'a> OtherTrait<'a> for &'a () {}
+
+    trait ObjectTrait {}
+    trait MyTrait {
+        fn use_self(&self) -> &() { panic!() }
+    }
+    trait Irrelevant {
+        fn use_self(&self) -> &() { panic!() }
+    }
+
+    impl MyTrait for dyn ObjectTrait + '_ {}
+    impl Irrelevant for dyn ObjectTrait {}
+
+    fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
+        MyTrait::use_self(val) //~ ERROR E0759
+    }
+}
+
 fn main() {}