]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/formatting.rs
iterate List by value
[rust.git] / tests / ui / formatting.rs
index 904c05b068c9df9d46b804404114d983a8ac6b34..078811b8d882b8ba378b8f3b86409f82a8b8fbb5 100644 (file)
@@ -4,8 +4,11 @@
 #![allow(clippy::if_same_then_else)]
 #![allow(clippy::deref_addrof)]
 
-fn foo() -> bool { true }
+fn foo() -> bool {
+    true
+}
 
+#[rustfmt::skip]
 fn main() {
     // weird `else` formatting:
     if foo() {
@@ -140,4 +143,15 @@ fn main() {
         true
         | false,
     ];
+
+    // don't lint if the indentation suggests not to
+    let _ = &[
+        1 + 2, 3 
+                - 4, 5
+    ];
+    // lint if it doesnt
+    let _ = &[
+        -1
+        -4,
+    ];
 }