]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/single_element_loop.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / single_element_loop.stderr
diff --git a/src/tools/clippy/tests/ui/single_element_loop.stderr b/src/tools/clippy/tests/ui/single_element_loop.stderr
new file mode 100644 (file)
index 0000000..90be1dc
--- /dev/null
@@ -0,0 +1,19 @@
+error: for loop over a single element
+  --> $DIR/single_element_loop.rs:7:5
+   |
+LL | /     for item in &[item1] {
+LL | |         println!("{}", item);
+LL | |     }
+   | |_____^
+   |
+   = note: `-D clippy::single-element-loop` implied by `-D warnings`
+help: try
+   |
+LL |     {
+LL |         let item = &item1;
+LL |         println!("{}", item);
+LL |     }
+   |
+
+error: aborting due to previous error
+