]> git.proxmox.com Git - rustc.git/blame - src/test/ui/mismatched_types/closure-mismatch.nll.stderr
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / mismatched_types / closure-mismatch.nll.stderr
CommitLineData
94222f64 1error: implementation of `FnOnce` is not general enough
f035d41b
XL
2 --> $DIR/closure-mismatch.rs:8:5
3 |
4LL | baz(|_| ());
94222f64
XL
5 | ^^^^^^^^^^^ implementation of `FnOnce` is not general enough
6 |
7 = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
8 = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
f035d41b 9
94222f64 10error[E0308]: mismatched types
f035d41b
XL
11 --> $DIR/closure-mismatch.rs:8:5
12 |
13LL | baz(|_| ());
94222f64
XL
14 | ^^^^^^^^^^^ one type is more general than the other
15 |
16 = note: expected type `for<'r> Fn<(&'r (),)>`
17 found type `Fn<(&(),)>`
18note: this closure does not fulfill the lifetime requirements
19 --> $DIR/closure-mismatch.rs:8:9
20 |
21LL | baz(|_| ());
22 | ^^^^^^
c295e0f8
XL
23note: the lifetime requirement is introduced here
24 --> $DIR/closure-mismatch.rs:5:11
25 |
26LL | fn baz<T: Foo>(_: T) {}
27 | ^^^
f035d41b
XL
28
29error: aborting due to 2 previous errors
30
94222f64 31For more information about this error, try `rustc --explain E0308`.