We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd2cd4c commit 37942c4Copy full SHA for 37942c4
src/test/ui/issues/issue-49919.rs
@@ -0,0 +1,7 @@
1
+fn foo<'a, T: 'a>(t: T) -> Box<dyn Fn() -> &'a T + 'a> {
2
+ let foo: Box<dyn for <'c> Fn() -> &'c T> = Box::new(move || &t);
3
+ //~^ ERROR: binding for associated type
4
+ unimplemented!()
5
+}
6
+
7
+fn main() {}
src/test/ui/issues/issue-49919.stderr
@@ -0,0 +1,9 @@
+error[E0582]: binding for associated type `Output` references lifetime `'c`, which does not appear in the trait input types
+ --> $DIR/issue-49919.rs:2:39
+ |
+LL | let foo: Box<dyn for <'c> Fn() -> &'c T> = Box::new(move || &t);
+ | ^^^^^
+error: aborting due to previous error
8
9
+For more information about this error, try `rustc --explain E0582`.
0 commit comments