diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
commit | 2ff14448863ac1a1dd9533461708e29aae170c2d (patch) | |
tree | 85b9fea2bbfe3f06473cfa381eed11f273b57c5c /src/test/ui/suggestions/return-closures.stderr | |
parent | Adding debian version 1.64.0+dfsg1-1. (diff) | |
download | rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip |
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/suggestions/return-closures.stderr | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/return-closures.stderr b/src/test/ui/suggestions/return-closures.stderr new file mode 100644 index 000000000..e273793ea --- /dev/null +++ b/src/test/ui/suggestions/return-closures.stderr @@ -0,0 +1,27 @@ +error[E0308]: mismatched types + --> $DIR/return-closures.rs:3:5 + | +LL | fn foo() { + | - help: try adding a return type: `-> impl for<'r> Fn(&'r i32) -> i32` +LL | +LL | |x: &i32| 1i32 + | ^^^^^^^^^^^^^^ expected `()`, found closure + | + = note: expected unit type `()` + found closure `[closure@$DIR/return-closures.rs:3:5: 3:14]` + +error[E0308]: mismatched types + --> $DIR/return-closures.rs:9:5 + | +LL | fn bar(i: impl Sized) { + | - help: a return type might be missing here: `-> _` +LL | +LL | || i + | ^^^^ expected `()`, found closure + | + = note: expected unit type `()` + found closure `[closure@$DIR/return-closures.rs:9:5: 9:7]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. |