]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/closure-mismatch.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / mismatched_types / closure-mismatch.stderr
1 error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.rs:18:9: 18:15] as std::ops::FnOnce<(&'r (),)>>::Output == ()`
2   --> $DIR/closure-mismatch.rs:18:5
3    |
4 LL |     baz(|_| ()); //~ ERROR type mismatch
5    |     ^^^ expected bound lifetime parameter, found concrete lifetime
6    |
7    = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
8 note: required by `baz`
9   --> $DIR/closure-mismatch.rs:15:1
10    |
11 LL | fn baz<T: Foo>(_: T) {}
12    | ^^^^^^^^^^^^^^^^^^^^
13
14 error[E0631]: type mismatch in closure arguments
15   --> $DIR/closure-mismatch.rs:18:5
16    |
17 LL |     baz(|_| ()); //~ ERROR type mismatch
18    |     ^^^ ------ found signature of `fn(_) -> _`
19    |     |
20    |     expected signature of `for<'r> fn(&'r ()) -> _`
21    |
22    = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
23 note: required by `baz`
24   --> $DIR/closure-mismatch.rs:15:1
25    |
26 LL | fn baz<T: Foo>(_: T) {}
27    | ^^^^^^^^^^^^^^^^^^^^
28
29 error: aborting due to 2 previous errors
30
31 Some errors occurred: E0271, E0631.
32 For more information about an error, try `rustc --explain E0271`.