Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3053bad

Browse files
Update ui-toml tests
1 parent a2c890f commit 3053bad

File tree

138 files changed

+888
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+888
-413
lines changed

tests/ui-toml/absolute_paths/absolute_paths_2015.default.stderr

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/ui-toml/absolute_paths/absolute_paths_2015.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@[default]rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/absolute_paths/default
33
//@[allow_crates]rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/absolute_paths/allow_crates
44
//@edition:2015
5+
//@check-pass
56

67
#![deny(clippy::absolute_paths)]
78

@@ -11,6 +12,4 @@ mod m1 {
1112
}
1213
}
1314

14-
fn main() {
15-
let _ = ::m1::m2::X; //~[default] absolute_paths
16-
}
15+
fn main() {}

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.fixed

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ fn main() {
77
let local_opt: Option<i32> = Some(3);
88

99
println!("val='{local_i32}'");
10+
//~^ uninlined_format_args
1011
println!("Hello x is {local_f64:.local_i32$}");
12+
//~^ uninlined_format_args
13+
//~| print_literal
1114
println!("Hello {local_i32} is {local_f64:.*}", 5);
15+
//~^ uninlined_format_args
1216
println!("Hello {local_i32} is {local_f64:.*}", 5);
17+
//~^ uninlined_format_args
1318
println!("{local_i32}, {}", local_opt.unwrap());
19+
//~^ uninlined_format_args
1420
}

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ fn main() {
77
let local_opt: Option<i32> = Some(3);
88

99
println!("val='{}'", local_i32);
10+
//~^ uninlined_format_args
1011
println!("Hello {} is {:.*}", "x", local_i32, local_f64);
12+
//~^ uninlined_format_args
13+
//~| print_literal
1114
println!("Hello {} is {:.*}", local_i32, 5, local_f64);
15+
//~^ uninlined_format_args
1216
println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
17+
//~^ uninlined_format_args
1318
println!("{}, {}", local_i32, local_opt.unwrap());
19+
//~^ uninlined_format_args
1420
}

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL + println!("val='{local_i32}'");
1313
|
1414

1515
error: variables can be used directly in the `format!` string
16-
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:10:5
16+
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:11:5
1717
|
1818
LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL + println!("Hello {} is {local_f64:.local_i32$}", "x");
2525
|
2626

2727
error: literal with an empty format string
28-
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:10:35
28+
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:11:35
2929
|
3030
LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
3131
| ^^^
@@ -39,7 +39,7 @@ LL + println!("Hello x is {:.*}", local_i32, local_f64);
3939
|
4040

4141
error: variables can be used directly in the `format!` string
42-
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:11:5
42+
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:14:5
4343
|
4444
LL | println!("Hello {} is {:.*}", local_i32, 5, local_f64);
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -51,7 +51,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
5151
|
5252

5353
error: variables can be used directly in the `format!` string
54-
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:12:5
54+
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:16:5
5555
|
5656
LL | println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
5757
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +63,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
6363
|
6464

6565
error: variables can be used directly in the `format!` string
66-
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:13:5
66+
--> tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs:18:5
6767
|
6868
LL | println!("{}, {}", local_i32, local_opt.unwrap());
6969
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
//@[bad_conf_1] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_1
66
//@[bad_conf_2] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_2
77
//@[bad_conf_3] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_3
8+
//@[default] check-pass
9+
//@[default_exp] check-pass
10+
//@[bad_conf_1] error-in-other-file:
11+
//@[bad_conf_2] error-in-other-file:
12+
//@[bad_conf_3] error-in-other-file:
813

914
#![allow(dead_code)]
1015
#![warn(clippy::arbitrary_source_item_ordering)]

tests/ui-toml/arbitrary_source_item_ordering/ordering_good_var_1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@aux-build:../../ui/auxiliary/proc_macros.rs
22
//@revisions: var_1
33
//@[var_1] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/var_1
4+
//@check-pass
45

56
#![allow(dead_code)]
67
#![warn(clippy::arbitrary_source_item_ordering)]

tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default.stderr

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
error: incorrect ordering of items (must be alphabetically ordered)
2-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:21:14
2+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:22:14
33
|
44
LL | use std::rc::Weak;
55
| ^^^^
66
|
77
note: should be placed before `SNAKE_CASE`
8-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:19:7
8+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:20:7
99
|
1010
LL | const SNAKE_CASE: &str = "zzzzzzzz";
1111
| ^^^^^^^^^^
1212
= note: `-D clippy::arbitrary-source-item-ordering` implied by `-D warnings`
1313
= help: to override `-D warnings` add `#[allow(clippy::arbitrary_source_item_ordering)]`
1414

1515
error: incorrect ordering of items (must be alphabetically ordered)
16-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:64:1
16+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:67:1
1717
|
1818
LL | / impl CloneSelf for StructOrdered {
19+
LL | |
1920
LL | | fn clone_self(&self) -> Self {
2021
LL | | Self {
21-
LL | | a: true,
2222
... |
2323
LL | | }
2424
| |_^
2525
|
2626
note: should be placed before the following item
27-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:54:1
27+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:57:1
2828
|
2929
LL | / impl Default for StructOrdered {
3030
LL | | fn default() -> Self {
@@ -35,55 +35,54 @@ LL | | }
3535
| |_^
3636

3737
error: incorrect ordering of items (must be alphabetically ordered)
38-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:136:7
38+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:145:7
3939
|
4040
LL | const ZIS_SHOULD_BE_REALLY_EARLY: () = ();
4141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
4242
|
4343
note: should be placed before `TraitUnorderedItemKinds`
44-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:124:7
44+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:132:7
4545
|
4646
LL | trait TraitUnorderedItemKinds {
4747
| ^^^^^^^^^^^^^^^^^^^^^^^
4848

4949
error: incorrect ordering of items (must be alphabetically ordered)
50-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:151:1
50+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:163:1
5151
|
5252
LL | impl BasicEmptyTrait for StructOrdered {}
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5454
|
5555
note: should be placed before the following item
56-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:138:1
56+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:148:1
5757
|
5858
LL | / impl TraitUnordered for StructUnordered {
5959
LL | | const A: bool = false;
6060
LL | | const C: bool = false;
6161
LL | | const B: bool = false;
6262
... |
63-
LL | | fn b() {}
6463
LL | | }
6564
| |_^
6665

6766
error: incorrect ordering of items (must be alphabetically ordered)
68-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:170:5
67+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:184:5
6968
|
7069
LL | mod this_is_in_the_wrong_position {
7170
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7271
|
7372
note: should be placed before `main`
74-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:165:4
73+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:179:4
7574
|
7675
LL | fn main() {
7776
| ^^^^
7877

7978
error: incorrect ordering of items (must be alphabetically ordered)
80-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:178:7
79+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:194:7
8180
|
8281
LL | const ZIS_SHOULD_BE_EVEN_EARLIER: () = ();
8382
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
8483
|
8584
note: should be placed before `ZisShouldBeBeforeZeMainFn`
86-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:176:8
85+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:192:8
8786
|
8887
LL | struct ZisShouldBeBeforeZeMainFn;
8988
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -101,121 +100,121 @@ LL | const BEFORE: i8 = 0;
101100
| ^^^^^^
102101

103102
error: incorrect ordering of items (must be alphabetically ordered)
104-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:38:5
103+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:40:5
105104
|
106105
LL | B,
107106
| ^
108107
|
109108
note: should be placed before `C`
110-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:37:5
109+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:39:5
111110
|
112111
LL | C,
113112
| ^
114113

115114
error: incorrect ordering of items (must be alphabetically ordered)
116-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:88:5
115+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:92:5
117116
|
118117
LL | b: bool,
119118
| ^
120119
|
121120
note: should be placed before `c`
122-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:87:5
121+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:91:5
123122
|
124123
LL | c: bool,
125124
| ^
126125

127126
error: incorrect ordering of items (must be alphabetically ordered)
128-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:96:5
127+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:101:5
129128
|
130129
LL | b: bool,
131130
| ^
132131
|
133132
note: should be placed before `c`
134-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:95:5
133+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:100:5
135134
|
136135
LL | c: bool,
137136
| ^
138137

139138
error: incorrect ordering of items (must be alphabetically ordered)
140-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:115:11
139+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:121:11
141140
|
142141
LL | const B: bool;
143142
| ^
144143
|
145144
note: should be placed before `C`
146-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:114:11
145+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:120:11
147146
|
148147
LL | const C: bool;
149148
| ^
150149

151150
error: incorrect ordering of items (must be alphabetically ordered)
152-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:121:8
151+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:128:8
153152
|
154153
LL | fn b();
155154
| ^
156155
|
157156
note: should be placed before `c`
158-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:120:8
157+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:127:8
159158
|
160159
LL | fn c();
161160
| ^
162161

163162
error: incorrect ordering of trait items (defined order: [Const, Type, Fn])
164-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:127:5
163+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:135:5
165164
|
166165
LL | const A: bool;
167166
| ^^^^^^^^^^^^^^
168167
|
169168
note: should be placed before `SomeType`
170-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:125:5
169+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:133:5
171170
|
172171
LL | type SomeType;
173172
| ^^^^^^^^^^^^^^
174173

175174
error: incorrect ordering of items (must be alphabetically ordered)
176-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:141:11
175+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:151:11
177176
|
178177
LL | const B: bool = false;
179178
| ^
180179
|
181180
note: should be placed before `C`
182-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:140:11
181+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:150:11
183182
|
184183
LL | const C: bool = false;
185184
| ^
186185

187186
error: incorrect ordering of items (must be alphabetically ordered)
188-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:147:8
187+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:158:8
189188
|
190189
LL | fn b() {}
191190
| ^
192191
|
193192
note: should be placed before `c`
194-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:146:8
193+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:157:8
195194
|
196195
LL | fn c() {}
197196
| ^
198197

199198
error: incorrect ordering of impl items (defined order: [Const, Type, Fn])
200-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:156:5
199+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:169:5
201200
|
202201
LL | const A: bool = false;
203202
| ^^^^^^^^^^^^^^^^^^^^^^
204203
|
205204
note: should be placed before `SomeType`
206-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:154:5
205+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:167:5
207206
|
208207
LL | type SomeType = ();
209208
| ^^^^^^^^^^^^^^^^^^^
210209

211210
error: incorrect ordering of items (must be alphabetically ordered)
212-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:172:11
211+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:187:11
213212
|
214213
LL | const A: i8 = 1;
215214
| ^
216215
|
217216
note: should be placed before `C`
218-
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:171:11
217+
--> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:186:11
219218
|
220219
LL | const C: i8 = 0;
221220
| ^

0 commit comments

Comments
 (0)