Closed
Description
// src/main.rs
#[derive(testing::Derive)]
pub struct S;
fn main() {}
// src/lib.rs
use proc_macro::TokenStream;
#[proc_macro_derive(Derive)]
pub fn derive(input: TokenStream) -> TokenStream {
let _ = input;
"fn _f() -> Vec<u8> { vec![] }".parse().unwrap()
}
$ cargo clippy
warning: use of irregular braces for `vec!` macro
--> src/main.rs:1:10
|
1 | #[derive(testing::Derive)]
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::nonstandard_macro_braces)]` on by default
help: consider writing `testing::Derive`
--> src/main.rs:1:10
|
1 | #[derive(testing::Derive)]
| ^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
= note: this warning originates in the derive macro `testing::Derive` (in Nightly builds, run with -Z macro-backtrace for more info)
vec![]
seems like the standard braces. The consider writing `testing::Derive`
doesn't make sense.
Meta
cargo clippy -V
: clippy 0.1.55 (798baeb 2021-07-02)rustc -Vv
:rustc 1.55.0-nightly (798baebde 2021-07-02) binary: rustc commit-hash: 798baebde1fe77e5a660490ec64e727a5d79970d commit-date: 2021-07-02 host: x86_64-unknown-linux-gnu release: 1.55.0-nightly LLVM version: 12.0.1