723f515b60
Rename unconventional -> nonstandard, add config field Add standard_macro_braces fields so users can specify macro names and brace combinations to lint for in the clippy.toml file. Fix errors caused by nonstandard_macro_braces in other lint tests Fix users ability to override the default nonstandard macro braces Add type position macros impl `check_ty`
95 lines
3.2 KiB
Plaintext
95 lines
3.2 KiB
Plaintext
error: use of irregular braces for `vec!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:29:13
|
|
|
|
|
LL | let _ = vec! {1, 2, 3};
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
|
|
help: consider writing `vec![1, 2, 3]`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:29:13
|
|
|
|
|
LL | let _ = vec! {1, 2, 3};
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: use of irregular braces for `format!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:30:13
|
|
|
|
|
LL | let _ = format!["ugh {} stop being such a good compiler", "hello"];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider writing `format!("ugh () stop being such a good compiler", "hello")`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:30:13
|
|
|
|
|
LL | let _ = format!["ugh {} stop being such a good compiler", "hello"];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: use of irregular braces for `quote!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:31:13
|
|
|
|
|
LL | let _ = quote!(let x = 1;);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider writing `quote! {let x = 1;}`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:31:13
|
|
|
|
|
LL | let _ = quote!(let x = 1;);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
error: use of irregular braces for `quote::quote!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:32:13
|
|
|
|
|
LL | let _ = quote::quote!(match match match);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider writing `quote::quote! {match match match}`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:32:13
|
|
|
|
|
LL | let _ = quote::quote!(match match match);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: use of irregular braces for `vec!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:10:9
|
|
|
|
|
LL | vec!{0, 0, 0}
|
|
| ^^^^^^^^^^^^^
|
|
...
|
|
LL | let _ = test!();
|
|
| ------- in this macro invocation
|
|
|
|
|
help: consider writing `vec![0, 0, 0]`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:10:9
|
|
|
|
|
LL | vec!{0, 0, 0}
|
|
| ^^^^^^^^^^^^^
|
|
...
|
|
LL | let _ = test!();
|
|
| ------- in this macro invocation
|
|
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: use of irregular braces for `type_pos!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:41:12
|
|
|
|
|
LL | let _: type_pos!(usize) = vec![];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider writing `type_pos![usize]`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:41:12
|
|
|
|
|
LL | let _: type_pos!(usize) = vec![];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
error: use of irregular braces for `eprint!` macro
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:43:5
|
|
|
|
|
LL | eprint!("test if user config overrides defaults");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider writing `eprint!["test if user config overrides defaults"];`
|
|
--> $DIR/conf_nonstandard_macro_braces.rs:43:5
|
|
|
|
|
LL | eprint!("test if user config overrides defaults");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 7 previous errors
|
|
|