]>
Commit | Line | Data |
---|---|---|
94222f64 | 1 | error: implementation of `FnOnce` is not general enough |
f035d41b XL |
2 | --> $DIR/closure-mismatch.rs:8:5 |
3 | | | |
4 | LL | 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 | 10 | error[E0308]: mismatched types |
f035d41b XL |
11 | --> $DIR/closure-mismatch.rs:8:5 |
12 | | | |
13 | LL | 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<(&(),)>` | |
18 | note: this closure does not fulfill the lifetime requirements | |
19 | --> $DIR/closure-mismatch.rs:8:9 | |
20 | | | |
21 | LL | baz(|_| ()); | |
22 | | ^^^^^^ | |
c295e0f8 XL |
23 | note: the lifetime requirement is introduced here |
24 | --> $DIR/closure-mismatch.rs:5:11 | |
25 | | | |
26 | LL | fn baz<T: Foo>(_: T) {} | |
27 | | ^^^ | |
f035d41b XL |
28 | |
29 | error: aborting due to 2 previous errors | |
30 | ||
94222f64 | 31 | For more information about this error, try `rustc --explain E0308`. |