]> git.proxmox.com Git - rustc.git/blob - src/test/ui/suggestions/sugg-else-for-closure.stderr
Update unsuspicious file list
[rustc.git] / src / test / 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 function 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 |
14 LL | pub const fn unwrap_or(self, default: T) -> T
15 | ^^^^^^^^^
16 help: try calling `unwrap_or_else` instead
17 |
18 LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
19 | +++++
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0308`.