1 // aux-build:proc_macro_suspicious_else_formatting.rs
3 #![warn(clippy::suspicious_else_formatting)]
4 #![allow(clippy::if_same_then_else)]
6 extern crate proc_macro_suspicious_else_formatting;
7 use proc_macro_suspicious_else_formatting::DeriveBadSpan;
15 // weird `else` formatting:
24 let _ = { // if as the last expression
34 let _ = { // if in the middle of a block
49 // This is fine, though weird. Allman style braces on the else.
58 if foo() { // the span of the above error should continue here
64 if foo() { // the span of the above error should continue here
87 // Almost Allman style braces. Lint these.
104 // #3864 - Allman style braces
113 // #7650 - Don't lint. Proc-macro using bad spans for `if` expressions.
114 #[derive(DeriveBadSpan)]
115 struct _Foo(u32, u32);