Skip to content

Commit a001ae3

Browse files
authored
Move uninlined_format_args back to style (#14160)
The `uninlined_format_args` was temporarily downgraded to `pedantic` in part because rust-analyzer was not fully supporting it at the time, per #10087. The support has been added over [a year ago](rust-lang/rust-analyzer#11260), so seems like this should be back to style. Another source of the initial frustration was fixed since then as well - this lint does not trigger by default in case only some arguments can be inlined. changelog: [`uninlined_format_args`]: move back to `style`
2 parents d95bdcf + 1ca79a8 commit a001ae3

34 files changed

+251
-217
lines changed

clippy_lints/src/format_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ declare_clippy_lint! {
141141
/// format!("{var:.prec$}");
142142
/// ```
143143
///
144-
/// If allow-mixed-uninlined-format-args is set to false in clippy.toml,
144+
/// If `allow-mixed-uninlined-format-args` is set to `false` in clippy.toml,
145145
/// the following code will also trigger the lint:
146146
/// ```no_run
147147
/// # let var = 42;
@@ -159,7 +159,7 @@ declare_clippy_lint! {
159159
/// nothing will be suggested, e.g. `println!("{0}={1}", var, 1+2)`.
160160
#[clippy::version = "1.66.0"]
161161
pub UNINLINED_FORMAT_ARGS,
162-
pedantic,
162+
style,
163163
"using non-inlined variables in `format!` calls"
164164
}
165165

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::uninlined_format_args)]
12
#![deny(clippy::index_refutable_slice)]
23

34
fn below_limit() {

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::uninlined_format_args)]
12
#![deny(clippy::index_refutable_slice)]
23

34
fn below_limit() {

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: this binding can be a slice pattern to avoid indexing
2-
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:5:17
2+
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:6:17
33
|
44
LL | if let Some(slice) = slice {
55
| ^^^^^
66
|
77
note: the lint level is defined here
8-
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:1:9
8+
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:2:9
99
|
1010
LL | #![deny(clippy::index_refutable_slice)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/author/macro_in_closure.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ check-pass
22

3+
#![allow(clippy::uninlined_format_args)]
4+
35
fn main() {
46
#[clippy::author]
57
let print_text = |x| println!("{}", x);

tests/ui/author/macro_in_loop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ check-pass
22

33
#![feature(stmt_expr_attributes)]
4+
#![allow(clippy::uninlined_format_args)]
45

56
fn main() {
67
#[clippy::author]

tests/ui/dbg_macro/dbg_macro.fixed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
#![allow(
2+
clippy::no_effect,
3+
clippy::uninlined_format_args,
4+
clippy::unit_arg,
5+
clippy::unnecessary_operation
6+
)]
17
#![warn(clippy::dbg_macro)]
2-
#![allow(clippy::unnecessary_operation, clippy::no_effect, clippy::unit_arg)]
38

49
fn foo(n: u32) -> u32 {
510
if let Some(n) = n.checked_sub(4) { n } else { n }

tests/ui/dbg_macro/dbg_macro.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
#![allow(
2+
clippy::no_effect,
3+
clippy::uninlined_format_args,
4+
clippy::unit_arg,
5+
clippy::unnecessary_operation
6+
)]
17
#![warn(clippy::dbg_macro)]
2-
#![allow(clippy::unnecessary_operation, clippy::no_effect, clippy::unit_arg)]
38

49
fn foo(n: u32) -> u32 {
510
if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }

tests/ui/dbg_macro/dbg_macro.stderr

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: the `dbg!` macro is intended as a debugging tool
2-
--> tests/ui/dbg_macro/dbg_macro.rs:5:22
2+
--> tests/ui/dbg_macro/dbg_macro.rs:10:22
33
|
44
LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
55
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL + if let Some(n) = n.checked_sub(4) { n } else { n }
1313
|
1414

1515
error: the `dbg!` macro is intended as a debugging tool
16-
--> tests/ui/dbg_macro/dbg_macro.rs:11:8
16+
--> tests/ui/dbg_macro/dbg_macro.rs:16:8
1717
|
1818
LL | if dbg!(n <= 1) {
1919
| ^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL + if n <= 1 {
2525
|
2626

2727
error: the `dbg!` macro is intended as a debugging tool
28-
--> tests/ui/dbg_macro/dbg_macro.rs:14:9
28+
--> tests/ui/dbg_macro/dbg_macro.rs:19:9
2929
|
3030
LL | dbg!(1)
3131
| ^^^^^^^
@@ -37,7 +37,7 @@ LL + 1
3737
|
3838

3939
error: the `dbg!` macro is intended as a debugging tool
40-
--> tests/ui/dbg_macro/dbg_macro.rs:17:9
40+
--> tests/ui/dbg_macro/dbg_macro.rs:22:9
4141
|
4242
LL | dbg!(n * factorial(n - 1))
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL + n * factorial(n - 1)
4949
|
5050

5151
error: the `dbg!` macro is intended as a debugging tool
52-
--> tests/ui/dbg_macro/dbg_macro.rs:23:5
52+
--> tests/ui/dbg_macro/dbg_macro.rs:28:5
5353
|
5454
LL | dbg!(42);
5555
| ^^^^^^^^
@@ -61,7 +61,7 @@ LL + 42;
6161
|
6262

6363
error: the `dbg!` macro is intended as a debugging tool
64-
--> tests/ui/dbg_macro/dbg_macro.rs:26:14
64+
--> tests/ui/dbg_macro/dbg_macro.rs:31:14
6565
|
6666
LL | foo(3) + dbg!(factorial(4));
6767
| ^^^^^^^^^^^^^^^^^^
@@ -73,7 +73,7 @@ LL + foo(3) + factorial(4);
7373
|
7474

7575
error: the `dbg!` macro is intended as a debugging tool
76-
--> tests/ui/dbg_macro/dbg_macro.rs:29:5
76+
--> tests/ui/dbg_macro/dbg_macro.rs:34:5
7777
|
7878
LL | dbg!(1, 2, 3, 4, 5);
7979
| ^^^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL + (1, 2, 3, 4, 5);
8585
|
8686

8787
error: the `dbg!` macro is intended as a debugging tool
88-
--> tests/ui/dbg_macro/dbg_macro.rs:51:5
88+
--> tests/ui/dbg_macro/dbg_macro.rs:56:5
8989
|
9090
LL | dbg!();
9191
| ^^^^^^
@@ -96,7 +96,7 @@ LL - dbg!();
9696
|
9797

9898
error: the `dbg!` macro is intended as a debugging tool
99-
--> tests/ui/dbg_macro/dbg_macro.rs:55:13
99+
--> tests/ui/dbg_macro/dbg_macro.rs:60:13
100100
|
101101
LL | let _ = dbg!();
102102
| ^^^^^^
@@ -108,7 +108,7 @@ LL + let _ = ();
108108
|
109109

110110
error: the `dbg!` macro is intended as a debugging tool
111-
--> tests/ui/dbg_macro/dbg_macro.rs:58:9
111+
--> tests/ui/dbg_macro/dbg_macro.rs:63:9
112112
|
113113
LL | bar(dbg!());
114114
| ^^^^^^
@@ -120,7 +120,7 @@ LL + bar(());
120120
|
121121

122122
error: the `dbg!` macro is intended as a debugging tool
123-
--> tests/ui/dbg_macro/dbg_macro.rs:61:10
123+
--> tests/ui/dbg_macro/dbg_macro.rs:66:10
124124
|
125125
LL | foo!(dbg!());
126126
| ^^^^^^
@@ -132,7 +132,7 @@ LL + foo!(());
132132
|
133133

134134
error: the `dbg!` macro is intended as a debugging tool
135-
--> tests/ui/dbg_macro/dbg_macro.rs:64:16
135+
--> tests/ui/dbg_macro/dbg_macro.rs:69:16
136136
|
137137
LL | foo2!(foo!(dbg!()));
138138
| ^^^^^^
@@ -144,7 +144,7 @@ LL + foo2!(foo!(()));
144144
|
145145

146146
error: the `dbg!` macro is intended as a debugging tool
147-
--> tests/ui/dbg_macro/dbg_macro.rs:46:13
147+
--> tests/ui/dbg_macro/dbg_macro.rs:51:13
148148
|
149149
LL | dbg!();
150150
| ^^^^^^
@@ -159,7 +159,7 @@ LL - dbg!();
159159
|
160160

161161
error: the `dbg!` macro is intended as a debugging tool
162-
--> tests/ui/dbg_macro/dbg_macro.rs:87:9
162+
--> tests/ui/dbg_macro/dbg_macro.rs:92:9
163163
|
164164
LL | dbg!(2);
165165
| ^^^^^^^
@@ -171,7 +171,7 @@ LL + 2;
171171
|
172172

173173
error: the `dbg!` macro is intended as a debugging tool
174-
--> tests/ui/dbg_macro/dbg_macro.rs:94:5
174+
--> tests/ui/dbg_macro/dbg_macro.rs:99:5
175175
|
176176
LL | dbg!(1);
177177
| ^^^^^^^
@@ -183,7 +183,7 @@ LL + 1;
183183
|
184184

185185
error: the `dbg!` macro is intended as a debugging tool
186-
--> tests/ui/dbg_macro/dbg_macro.rs:100:5
186+
--> tests/ui/dbg_macro/dbg_macro.rs:105:5
187187
|
188188
LL | dbg!(1);
189189
| ^^^^^^^
@@ -195,7 +195,7 @@ LL + 1;
195195
|
196196

197197
error: the `dbg!` macro is intended as a debugging tool
198-
--> tests/ui/dbg_macro/dbg_macro.rs:107:9
198+
--> tests/ui/dbg_macro/dbg_macro.rs:112:9
199199
|
200200
LL | dbg!(1);
201201
| ^^^^^^^
@@ -207,7 +207,7 @@ LL + 1;
207207
|
208208

209209
error: the `dbg!` macro is intended as a debugging tool
210-
--> tests/ui/dbg_macro/dbg_macro.rs:114:31
210+
--> tests/ui/dbg_macro/dbg_macro.rs:119:31
211211
|
212212
LL | println!("dbg: {:?}", dbg!(s));
213213
| ^^^^^^^
@@ -219,7 +219,7 @@ LL + println!("dbg: {:?}", s);
219219
|
220220

221221
error: the `dbg!` macro is intended as a debugging tool
222-
--> tests/ui/dbg_macro/dbg_macro.rs:117:22
222+
--> tests/ui/dbg_macro/dbg_macro.rs:122:22
223223
|
224224
LL | print!("{}", dbg!(s));
225225
| ^^^^^^^

tests/ui/large_futures.fixed

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#![allow(
2+
clippy::future_not_send,
3+
clippy::manual_async_fn,
4+
clippy::never_loop,
5+
clippy::uninlined_format_args
6+
)]
17
#![warn(clippy::large_futures)]
2-
#![allow(clippy::never_loop)]
3-
#![allow(clippy::future_not_send)]
4-
#![allow(clippy::manual_async_fn)]
58

69
async fn big_fut(_arg: [u8; 1024 * 16]) {}
710

0 commit comments

Comments
 (0)