]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-return-type-mismatch.stderr
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / closures / closure-return-type-mismatch.stderr
1 error[E0308]: mismatched types
2   --> $DIR/closure-return-type-mismatch.rs:7:9
3    |
4 LL |         a
5    |         ^ expected `&str`, found `bool`
6    |
7 note: return type inferred to be `&str` here
8   --> $DIR/closure-return-type-mismatch.rs:4:20
9    |
10 LL |             return "test";
11    |                    ^^^^^^
12
13 error[E0308]: mismatched types
14   --> $DIR/closure-return-type-mismatch.rs:12:20
15    |
16 LL |             return "hello"
17    |                    ^^^^^^^ expected `bool`, found `&str`
18
19 error: aborting due to 2 previous errors
20
21 For more information about this error, try `rustc --explain E0308`.