diff options
Diffstat (limited to 'src/test/ui/suggestions/sugg-else-for-closure.stderr')
-rw-r--r-- | src/test/ui/suggestions/sugg-else-for-closure.stderr | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/sugg-else-for-closure.stderr b/src/test/ui/suggestions/sugg-else-for-closure.stderr new file mode 100644 index 000000000..55a0eee18 --- /dev/null +++ b/src/test/ui/suggestions/sugg-else-for-closure.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/sugg-else-for-closure.rs:6:26 + | +LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); + | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure + | | + | arguments to this function are incorrect + | + = note: expected reference `&str` + found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` +note: associated function defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub const fn unwrap_or(self, default: T) -> T + | ^^^^^^^^^ +help: try calling `unwrap_or_else` instead + | +LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap()); + | +++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. |