]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/rustfmt/tests/target/spaces-around-ranges.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / rustfmt / tests / target / spaces-around-ranges.rs
diff --git a/src/tools/rustfmt/tests/target/spaces-around-ranges.rs b/src/tools/rustfmt/tests/target/spaces-around-ranges.rs
new file mode 100644 (file)
index 0000000..b53e5b5
--- /dev/null
@@ -0,0 +1,15 @@
+// rustfmt-spaces_around_ranges: true
+
+fn bar(v: &[u8]) {}
+
+fn foo() {
+    let a = vec![0; 20];
+    for j in 0 ..= 20 {
+        for i in 0 .. 3 {
+            bar(a[i .. j]);
+            bar(a[i ..]);
+            bar(a[.. j]);
+            bar(a[..= (j + 1)]);
+        }
+    }
+}