summaryrefslogtreecommitdiffstats
path: root/src/test/ui/loops/loop-labeled-break-value.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/loops/loop-labeled-break-value.stderr')
-rw-r--r--src/test/ui/loops/loop-labeled-break-value.stderr30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/loops/loop-labeled-break-value.stderr b/src/test/ui/loops/loop-labeled-break-value.stderr
new file mode 100644
index 000000000..aa04d330f
--- /dev/null
+++ b/src/test/ui/loops/loop-labeled-break-value.stderr
@@ -0,0 +1,30 @@
+error[E0308]: mismatched types
+ --> $DIR/loop-labeled-break-value.rs:3:29
+ |
+LL | let _: i32 = loop { break };
+ | ^^^^^
+ | |
+ | expected `i32`, found `()`
+ | help: give it a value of the expected type: `break 42`
+
+error[E0308]: mismatched types
+ --> $DIR/loop-labeled-break-value.rs:6:37
+ |
+LL | let _: i32 = 'inner: loop { break 'inner };
+ | ^^^^^^^^^^^^
+ | |
+ | expected `i32`, found `()`
+ | help: give it a value of the expected type: `break 'inner 42`
+
+error[E0308]: mismatched types
+ --> $DIR/loop-labeled-break-value.rs:9:45
+ |
+LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } };
+ | ^^^^^^^^^^^^^
+ | |
+ | expected `i32`, found `()`
+ | help: give it a value of the expected type: `break 'inner2 42`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.