rust-clippy/tests/ui/format.stderr
Philipp Hansch ff98e3f9f5
Fix useless_format false positive with macros
Clippy was issuing a warning when `format!` was used inside a macro.
That's a problem because macros have different syntax and can be outside
the control of the user.

This skips the `useless_format` check if the `format!` call is inside a
macro.
2018-04-05 07:52:26 +02:00

10 lines
269 B
Text

error: useless use of `format!`
--> $DIR/format.rs:12:5
|
12 | format!("foo");
| ^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string()`
|
= note: `-D useless-format` implied by `-D warnings`
error: aborting due to previous error