Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

clippy::nonstandard_macro_braces #514

@jbr

Description

@jbr

Hi! recently, the following warning started showing up on nightly clippy:

warning: use of irregular braces for `write!` macro
  --> example/src/main.rs:14:10
   |
14 | #[derive(Template)]
   |          ^^^^^^^^
   |
   = note: `#[warn(clippy::nonstandard_macro_braces)]` on by default
help: consider writing `Template`
  --> example/src/main.rs:14:10
   |
14 | #[derive(Template)]
   |          ^^^^^^^^
   = 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 `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 1 warning emitted

Running RUSTFLAGS="-Z macro-backtrace" cargo clippy -Z unstable-options results in

warning: use of irregular braces for `write!` macro
  --> aws-lambda-example/src/main.rs:10:10
   |
10 | #[derive(Template)]
   |          ^^^^^^^^ in this macro invocation
   |
  ::: /Users/jbr/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/askama_derive-0.10.5/src/lib.rs:16:1
   |
16 | pub fn derive_template(input: TokenStream) -> TokenStream {
   | --------------------------------------------------------- in this expansion of procedural macro `#[derive(Template)]`
   |
   = note: `#[warn(clippy::nonstandard_macro_braces)]` on by default
help: consider writing `Template`
  --> aws-lambda-example/src/main.rs:10:10
   |
10 | #[derive(Template)]
   |          ^^^^^^^^ in this macro invocation
   |
  ::: /Users/jbr/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/askama_derive-0.10.5/src/lib.rs:16:1
   |
16 | pub fn derive_template(input: TokenStream) -> TokenStream {
   | --------------------------------------------------------- in this expansion of procedural macro `#[derive(Template)]`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces

warning: 1 warning emitted

which isn't particularly helpful, but somewhere in askama-derive there's a nonstandard brace for write!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions