Add test for #49919
This commit is contained in:
parent
cd2cd4c962
commit
37942c4753
7
src/test/ui/issues/issue-49919.rs
Normal file
7
src/test/ui/issues/issue-49919.rs
Normal file
@ -0,0 +1,7 @@
|
||||
fn foo<'a, T: 'a>(t: T) -> Box<dyn Fn() -> &'a T + 'a> {
|
||||
let foo: Box<dyn for <'c> Fn() -> &'c T> = Box::new(move || &t);
|
||||
//~^ ERROR: binding for associated type
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn main() {}
|
9
src/test/ui/issues/issue-49919.stderr
Normal file
9
src/test/ui/issues/issue-49919.stderr
Normal file
@ -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
|
||||
|
||||
For more information about this error, try `rustc --explain E0582`.
|
Loading…
Reference in New Issue
Block a user