mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
More specific spans for use_debug
lint
This commit is contained in:
parent
4450c21f51
commit
4c1047167d
2 changed files with 7 additions and 7 deletions
|
@ -456,7 +456,7 @@ impl Write {
|
||||||
|
|
||||||
if !self.in_debug_impl && arg.format.ty == "?" {
|
if !self.in_debug_impl && arg.format.ty == "?" {
|
||||||
// FIXME: modify rustc's fmt string parser to give us the current span
|
// FIXME: modify rustc's fmt string parser to give us the current span
|
||||||
span_lint(cx, USE_DEBUG, str.span, "use of `Debug`-based formatting");
|
span_lint(cx, USE_DEBUG, span, "use of `Debug`-based formatting");
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push(arg, span);
|
args.push(arg, span);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
error: use of `Debug`-based formatting
|
error: use of `Debug`-based formatting
|
||||||
--> $DIR/print.rs:11:19
|
--> $DIR/print.rs:11:20
|
||||||
|
|
|
|
||||||
LL | write!(f, "{:?}", 43.1415)
|
LL | write!(f, "{:?}", 43.1415)
|
||||||
| ^^^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= note: `-D clippy::use-debug` implied by `-D warnings`
|
= note: `-D clippy::use-debug` implied by `-D warnings`
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ LL | print!("Hello {:?}", "World");
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: use of `Debug`-based formatting
|
error: use of `Debug`-based formatting
|
||||||
--> $DIR/print.rs:28:12
|
--> $DIR/print.rs:28:19
|
||||||
|
|
|
|
||||||
LL | print!("Hello {:?}", "World");
|
LL | print!("Hello {:?}", "World");
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^
|
||||||
|
|
||||||
error: use of `print!`
|
error: use of `print!`
|
||||||
--> $DIR/print.rs:30:5
|
--> $DIR/print.rs:30:5
|
||||||
|
@ -45,10 +45,10 @@ LL | print!("Hello {:#?}", "#orld");
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: use of `Debug`-based formatting
|
error: use of `Debug`-based formatting
|
||||||
--> $DIR/print.rs:30:12
|
--> $DIR/print.rs:30:19
|
||||||
|
|
|
|
||||||
LL | print!("Hello {:#?}", "#orld");
|
LL | print!("Hello {:#?}", "#orld");
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: aborting due to 8 previous errors
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue