summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/format_args.stderr
blob: f1832b970198a42cac9fa311b2ae00810818723d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
error: `to_string` applied to a type that implements `Display` in `format!` args
  --> $DIR/format_args.rs:77: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:81: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:86: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:88: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:89: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:90: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:91: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:92: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:93: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:94: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:95: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:96: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:97: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:98: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:99: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:100: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:101:20
   |
LL |     println!("{}", x_ref.to_string());
   |                    ^^^^^^^^^^^^^^^^^ help: use this: `***x_ref`

error: `to_string` applied to a type that implements `Display` in `println!` args
  --> $DIR/format_args.rs:103:39
   |
LL |     println!("{foo}{bar}", foo = "foo".to_string(), bar = "bar");
   |                                       ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `println!` args
  --> $DIR/format_args.rs:104:52
   |
LL |     println!("{foo}{bar}", foo = "foo", bar = "bar".to_string());
   |                                                    ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `println!` args
  --> $DIR/format_args.rs:105:39
   |
LL |     println!("{foo}{bar}", bar = "bar".to_string(), foo = "foo");
   |                                       ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `println!` args
  --> $DIR/format_args.rs:106:52
   |
LL |     println!("{foo}{bar}", bar = "bar", foo = "foo".to_string());
   |                                                    ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `print!` args
  --> $DIR/format_args.rs:118:37
   |
LL |     print!("{}", (Location::caller().to_string()));
   |                                     ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `print!` args
  --> $DIR/format_args.rs:119:39
   |
LL |     print!("{}", ((Location::caller()).to_string()));
   |                                       ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `format!` args
  --> $DIR/format_args.rs:147:38
   |
LL |         let x = format!("{} {}", a, b.to_string());
   |                                      ^^^^^^^^^^^^ help: remove this

error: `to_string` applied to a type that implements `Display` in `println!` args
  --> $DIR/format_args.rs:161:24
   |
LL |         println!("{}", original[..10].to_string());
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&original[..10]`

error: aborting due to 25 previous errors