]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/sugg-else-for-closure.stderr
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
[rust.git] / tests / ui / suggestions / sugg-else-for-closure.stderr
1 error[E0308]: mismatched types
2   --> $DIR/sugg-else-for-closure.rs:6:26
3    |
4 LL |     let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
5    |                --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure
6    |                |
7    |                arguments to this method are incorrect
8    |
9    = note: expected reference `&str`
10                 found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]`
11 note: associated function defined here
12   --> $SRC_DIR/core/src/option.rs:LL:COL
13 help: try calling `unwrap_or_else` instead
14    |
15 LL |     let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
16    |                         +++++
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0308`.