]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/closure-mismatch.stderr
Rollup merge of #89945 - JohnTitor:we-now-specialize-clone-from-slice, r=the8472
[rust.git] / src / test / ui / mismatched_types / closure-mismatch.stderr
1 error[E0308]: mismatched types
2   --> $DIR/closure-mismatch.rs:8:5
3    |
4 LL |     baz(|_| ());
5    |     ^^^ lifetime mismatch
6    |
7    = note: expected type `for<'r> Fn<(&'r (),)>`
8               found type `Fn<(&(),)>`
9 note: this closure does not fulfill the lifetime requirements
10   --> $DIR/closure-mismatch.rs:8:9
11    |
12 LL |     baz(|_| ());
13    |         ^^^^^^
14 note: the lifetime requirement is introduced here
15   --> $DIR/closure-mismatch.rs:5:11
16    |
17 LL | fn baz<T: Foo>(_: T) {}
18    |           ^^^
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0308`.