Skip to content

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Sep 19, 2025

Closes #408.

Example lint:

warning: `format!` in `bail!` args
 --> src/main.rs:5:5
  |
5 |     bail!("{}", format!("something failed at {}", Location::caller()));
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: combine the `format!(..)` arguments with the outer `bail!(..)` call
  = help: or consider changing `format!` to `format_args!`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args
  = note: `#[warn(clippy::format_in_format_args)]` on by default

@dtolnay dtolnay merged commit f271988 into master Sep 19, 2025
28 checks passed
@dtolnay dtolnay deleted the clippyfmt branch September 19, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add #[clippy::format_args] on some macros

1 participant