summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/break-and-continue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/source/break-and-continue.rs')
-rw-r--r--src/tools/rustfmt/tests/source/break-and-continue.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/break-and-continue.rs b/src/tools/rustfmt/tests/source/break-and-continue.rs
new file mode 100644
index 000000000..c01d8a078
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/break-and-continue.rs
@@ -0,0 +1,23 @@
+// break and continue formatting
+
+#![feature(loop_break_value)]
+
+fn main() {
+ 'a: loop {
+ break 'a;
+ }
+
+ let mut done = false;
+ 'b: while !done {
+ done = true;
+ continue 'b;
+ }
+
+ let x = loop {
+ break 5;
+ };
+
+ let x = 'c: loop {
+ break 'c 5;
+ };
+}