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/for-loop-while/break-while-condition.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/for-loop-while/break-while-condition.stderr | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/for-loop-while/break-while-condition.stderr b/src/test/ui/for-loop-while/break-while-condition.stderr index 6960c4fd8..e79f6a75f 100644 --- a/src/test/ui/for-loop-while/break-while-condition.stderr +++ b/src/test/ui/for-loop-while/break-while-condition.stderr @@ -31,6 +31,14 @@ LL | | } | = note: expected type `!` found unit type `()` +note: the function expects a value to always be returned, but loops might run zero times + --> $DIR/break-while-condition.rs:24:13 + | +LL | while false { + | ^^^^^^^^^^^ this might have zero elements to iterate on +LL | return + | ------ if the loop doesn't execute, this value would never get returned + = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility error: aborting due to 3 previous errors |