]> git.proxmox.com Git - rustc.git/blame - src/test/ui/mismatched_types/closure-mismatch.stderr
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / mismatched_types / closure-mismatch.stderr
CommitLineData
0731742a
XL
1error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.rs:8:9: 8:15] as std::ops::FnOnce<(&'r (),)>>::Output == ()`
2 --> $DIR/closure-mismatch.rs:8:5
7cac9316 3 |
532ac7d7 4LL | baz(|_| ());
7cac9316
XL
5 | ^^^ expected bound lifetime parameter, found concrete lifetime
6 |
0731742a 7 = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:8:9: 8:15]`
2c00a5a8 8note: required by `baz`
0731742a 9 --> $DIR/closure-mismatch.rs:5:1
2c00a5a8 10 |
0531ce1d 11LL | fn baz<T: Foo>(_: T) {}
2c00a5a8 12 | ^^^^^^^^^^^^^^^^^^^^
7cac9316 13
ea8adc8c 14error[E0631]: type mismatch in closure arguments
0731742a 15 --> $DIR/closure-mismatch.rs:8:5
7cac9316 16 |
532ac7d7 17LL | baz(|_| ());
ea8adc8c 18 | ^^^ ------ found signature of `fn(_) -> _`
7cac9316 19 | |
ea8adc8c 20 | expected signature of `for<'r> fn(&'r ()) -> _`
7cac9316 21 |
0731742a 22 = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:8:9: 8:15]`
2c00a5a8 23note: required by `baz`
0731742a 24 --> $DIR/closure-mismatch.rs:5:1
2c00a5a8 25 |
0531ce1d 26LL | fn baz<T: Foo>(_: T) {}
2c00a5a8 27 | ^^^^^^^^^^^^^^^^^^^^
7cac9316 28
041b39d2 29error: aborting due to 2 previous errors
7cac9316 30
48663c56 31For more information about this error, try `rustc --explain E0271`.