Skip to content

Commit 37942c4

Browse files
committed
Add test for #49919
1 parent cd2cd4c commit 37942c4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/test/ui/issues/issue-49919.rs

+7
Original file line numberDiff line numberDiff line change
@@ -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

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0582]: binding for associated type `Output` references lifetime `'c`, which does not appear in the trait input types
2+
--> $DIR/issue-49919.rs:2:39
3+
|
4+
LL | let foo: Box<dyn for <'c> Fn() -> &'c T> = Box::new(move || &t);
5+
| ^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0582`.

0 commit comments

Comments
 (0)