mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
c9599d79a3
Fixes #7667 and #7729
106 lines
4.7 KiB
Text
106 lines
4.7 KiB
Text
error: `to_string` applied to a type that implements `Display` in `format!` args
|
|
--> $DIR/format_args.rs:75:72
|
|
|
|
|
LL | let _ = format!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
|
= note: `-D clippy::to-string-in-format-args` implied by `-D warnings`
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `write!` args
|
|
--> $DIR/format_args.rs:79:27
|
|
|
|
|
LL | Location::caller().to_string()
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `writeln!` args
|
|
--> $DIR/format_args.rs:84:27
|
|
|
|
|
LL | Location::caller().to_string()
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `print!` args
|
|
--> $DIR/format_args.rs:86:63
|
|
|
|
|
LL | print!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `println!` args
|
|
--> $DIR/format_args.rs:87:65
|
|
|
|
|
LL | println!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `eprint!` args
|
|
--> $DIR/format_args.rs:88:64
|
|
|
|
|
LL | eprint!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `eprintln!` args
|
|
--> $DIR/format_args.rs:89:66
|
|
|
|
|
LL | eprintln!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `format_args!` args
|
|
--> $DIR/format_args.rs:90:77
|
|
|
|
|
LL | let _ = format_args!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `assert!` args
|
|
--> $DIR/format_args.rs:91:70
|
|
|
|
|
LL | assert!(true, "error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `assert_eq!` args
|
|
--> $DIR/format_args.rs:92:73
|
|
|
|
|
LL | assert_eq!(0, 0, "error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `assert_ne!` args
|
|
--> $DIR/format_args.rs:93:73
|
|
|
|
|
LL | assert_ne!(0, 0, "error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `panic!` args
|
|
--> $DIR/format_args.rs:94:63
|
|
|
|
|
LL | panic!("error: something failed at {}", Location::caller().to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `println!` args
|
|
--> $DIR/format_args.rs:95:20
|
|
|
|
|
LL | println!("{}", X(1).to_string());
|
|
| ^^^^^^^^^^^^^^^^ help: use this: `*X(1)`
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `println!` args
|
|
--> $DIR/format_args.rs:96:20
|
|
|
|
|
LL | println!("{}", Y(&X(1)).to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: use this: `***Y(&X(1))`
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `println!` args
|
|
--> $DIR/format_args.rs:97:24
|
|
|
|
|
LL | println!("{}", Z(1).to_string());
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `println!` args
|
|
--> $DIR/format_args.rs:98:20
|
|
|
|
|
LL | println!("{}", x.to_string());
|
|
| ^^^^^^^^^^^^^ help: use this: `**x`
|
|
|
|
error: `to_string` applied to a type that implements `Display` in `println!` args
|
|
--> $DIR/format_args.rs:99:20
|
|
|
|
|
LL | println!("{}", x_ref.to_string());
|
|
| ^^^^^^^^^^^^^^^^^ help: use this: `***x_ref`
|
|
|
|
error: aborting due to 17 previous errors
|
|
|