Skip to content

Commit a390206

Browse files
authored
Rollup merge of #81900 - vandenheuvel:organize_trait_tests, r=Mark-Simulacrum
Organize trait test files Organizes trait tests in folders where reasonable and removes name redundancies.
2 parents 4cb3810 + 0d96a79 commit a390206

File tree

288 files changed

+285
-285
lines changed

Some content is hidden

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

288 files changed

+285
-285
lines changed

src/test/ui/traits/trait-alias-ambiguous.stderr src/test/ui/traits/alias/ambiguous.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error[E0034]: multiple applicable items in scope
2-
--> $DIR/trait-alias-ambiguous.rs:21:7
2+
--> $DIR/ambiguous.rs:21:7
33
|
44
LL | t.foo();
55
| ^^^ multiple `foo` found
66
|
77
note: candidate #1 is defined in an impl of the trait `A` for the type `u8`
8-
--> $DIR/trait-alias-ambiguous.rs:8:9
8+
--> $DIR/ambiguous.rs:8:9
99
|
1010
LL | fn foo(&self) {}
1111
| ^^^^^^^^^^^^^
1212
note: candidate #2 is defined in an impl of the trait `B` for the type `u8`
13-
--> $DIR/trait-alias-ambiguous.rs:11:9
13+
--> $DIR/ambiguous.rs:11:9
1414
|
1515
LL | fn foo(&self) {}
1616
| ^^^^^^^^^^^^^

src/test/ui/traits/trait-alias/trait-alias-cross-crate.rs src/test/ui/traits/alias/cross-crate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// aux-build:trait_alias.rs
1+
// aux-build:send_sync.rs
22

33
#![feature(trait_alias)]
44

5-
extern crate trait_alias;
5+
extern crate send_sync;
66

77
use std::rc::Rc;
8-
use trait_alias::SendSync;
8+
use send_sync::SendSync;
99

1010
fn use_alias<T: SendSync>() {}
1111

src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr src/test/ui/traits/alias/cross-crate.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `Rc<u32>` cannot be sent between threads safely
2-
--> $DIR/trait-alias-cross-crate.rs:14:17
2+
--> $DIR/cross-crate.rs:14:17
33
|
44
LL | fn use_alias<T: SendSync>() {}
55
| -------- required by this bound in `use_alias`
@@ -10,7 +10,7 @@ LL | use_alias::<Rc<u32>>();
1010
= help: the trait `Send` is not implemented for `Rc<u32>`
1111

1212
error[E0277]: `Rc<u32>` cannot be shared between threads safely
13-
--> $DIR/trait-alias-cross-crate.rs:14:17
13+
--> $DIR/cross-crate.rs:14:17
1414
|
1515
LL | fn use_alias<T: SendSync>() {}
1616
| -------- required by this bound in `use_alias`

src/test/ui/traits/trait-alias/trait-alias-impl.stderr src/test/ui/traits/alias/impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0404]: expected trait, found trait alias `DefaultAlias`
2-
--> $DIR/trait-alias-impl.rs:5:6
2+
--> $DIR/impl.rs:5:6
33
|
44
LL | impl DefaultAlias for () {}
55
| ^^^^^^^^^^^^ not a trait

src/test/ui/traits/trait-alias-import-cross-crate.rs src/test/ui/traits/alias/import-cross-crate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// run-pass
2-
// aux-build:trait_alias.rs
2+
// aux-build:greeter.rs
33

44
#![feature(trait_alias)]
55

6-
extern crate trait_alias;
6+
extern crate greeter;
77

88
// Import only the alias, not the real trait.
9-
use trait_alias::{Greet, Hi};
9+
use greeter::{Greet, Hi};
1010

1111
fn main() {
1212
let hi = Hi;
File renamed without changes.

src/test/ui/traits/trait-alias/trait-alias-no-duplicates.stderr src/test/ui/traits/alias/no-duplicates.stderr

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0225]: only auto traits can be used as additional traits in a trait object
2-
--> $DIR/trait-alias-no-duplicates.rs:16:22
2+
--> $DIR/no-duplicates.rs:16:22
33
|
44
LL | trait _0 = Obj;
55
| ---
@@ -16,7 +16,7 @@ LL | type _T00 = dyn _0 + _0;
1616
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
1717

1818
error[E0225]: only auto traits can be used as additional traits in a trait object
19-
--> $DIR/trait-alias-no-duplicates.rs:19:22
19+
--> $DIR/no-duplicates.rs:19:22
2020
|
2121
LL | trait _0 = Obj;
2222
| ---
@@ -35,7 +35,7 @@ LL | type _T01 = dyn _1 + _0;
3535
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
3636

3737
error[E0225]: only auto traits can be used as additional traits in a trait object
38-
--> $DIR/trait-alias-no-duplicates.rs:22:22
38+
--> $DIR/no-duplicates.rs:22:22
3939
|
4040
LL | trait _0 = Obj;
4141
| ---
@@ -57,7 +57,7 @@ LL | type _T02 = dyn _1 + _1;
5757
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
5858

5959
error[E0225]: only auto traits can be used as additional traits in a trait object
60-
--> $DIR/trait-alias-no-duplicates.rs:25:23
60+
--> $DIR/no-duplicates.rs:25:23
6161
|
6262
LL | trait _0 = Obj;
6363
| --- additional non-auto trait
@@ -73,7 +73,7 @@ LL | type _T03 = dyn Obj + _1;
7373
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
7474

7575
error[E0225]: only auto traits can be used as additional traits in a trait object
76-
--> $DIR/trait-alias-no-duplicates.rs:28:22
76+
--> $DIR/no-duplicates.rs:28:22
7777
|
7878
LL | trait _0 = Obj;
7979
| --- first non-auto trait
@@ -89,7 +89,7 @@ LL | type _T04 = dyn _1 + Obj;
8989
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
9090

9191
error[E0225]: only auto traits can be used as additional traits in a trait object
92-
--> $DIR/trait-alias-no-duplicates.rs:37:17
92+
--> $DIR/no-duplicates.rs:37:17
9393
|
9494
LL | trait _0 = Obj;
9595
| ---
@@ -114,7 +114,7 @@ LL | type _T10 = dyn _2 + _3;
114114
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
115115

116116
error[E0225]: only auto traits can be used as additional traits in a trait object
117-
--> $DIR/trait-alias-no-duplicates.rs:40:22
117+
--> $DIR/no-duplicates.rs:40:22
118118
|
119119
LL | trait _0 = Obj;
120120
| --- additional non-auto trait
@@ -133,7 +133,7 @@ LL | type _T11 = dyn _3 + _2;
133133
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
134134

135135
error[E0225]: only auto traits can be used as additional traits in a trait object
136-
--> $DIR/trait-alias-no-duplicates.rs:43:23
136+
--> $DIR/no-duplicates.rs:43:23
137137
|
138138
LL | trait _0 = Obj;
139139
| --- additional non-auto trait
@@ -150,7 +150,7 @@ LL | type _T12 = dyn Obj + _2;
150150
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
151151

152152
error[E0225]: only auto traits can be used as additional traits in a trait object
153-
--> $DIR/trait-alias-no-duplicates.rs:46:17
153+
--> $DIR/no-duplicates.rs:46:17
154154
|
155155
LL | trait _0 = Obj;
156156
| ---
@@ -175,7 +175,7 @@ LL | type _T13 = dyn _2 + Obj;
175175
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
176176

177177
error[E0225]: only auto traits can be used as additional traits in a trait object
178-
--> $DIR/trait-alias-no-duplicates.rs:49:22
178+
--> $DIR/no-duplicates.rs:49:22
179179
|
180180
LL | trait _0 = Obj;
181181
| --- first non-auto trait
@@ -194,7 +194,7 @@ LL | type _T14 = dyn _1 + _3;
194194
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
195195

196196
error[E0225]: only auto traits can be used as additional traits in a trait object
197-
--> $DIR/trait-alias-no-duplicates.rs:52:22
197+
--> $DIR/no-duplicates.rs:52:22
198198
|
199199
LL | trait _0 = Obj;
200200
| --- additional non-auto trait
@@ -213,7 +213,7 @@ LL | type _T15 = dyn _3 + _1;
213213
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
214214

215215
error[E0225]: only auto traits can be used as additional traits in a trait object
216-
--> $DIR/trait-alias-no-duplicates.rs:55:22
216+
--> $DIR/no-duplicates.rs:55:22
217217
|
218218
LL | trait _0 = Obj;
219219
| --- first non-auto trait
@@ -234,7 +234,7 @@ LL | type _T16 = dyn _1 + _4;
234234
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
235235

236236
error[E0225]: only auto traits can be used as additional traits in a trait object
237-
--> $DIR/trait-alias-no-duplicates.rs:58:22
237+
--> $DIR/no-duplicates.rs:58:22
238238
|
239239
LL | trait _0 = Obj;
240240
| --- additional non-auto trait
@@ -255,7 +255,7 @@ LL | type _T17 = dyn _4 + _1;
255255
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
256256

257257
error[E0225]: only auto traits can be used as additional traits in a trait object
258-
--> $DIR/trait-alias-no-duplicates.rs:65:22
258+
--> $DIR/no-duplicates.rs:65:22
259259
|
260260
LL | trait _5 = Obj + Send;
261261
| ---
@@ -272,7 +272,7 @@ LL | type _T20 = dyn _5 + _5;
272272
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
273273

274274
error[E0225]: only auto traits can be used as additional traits in a trait object
275-
--> $DIR/trait-alias-no-duplicates.rs:68:23
275+
--> $DIR/no-duplicates.rs:68:23
276276
|
277277
LL | trait _5 = Obj + Send;
278278
| --- additional non-auto trait
@@ -286,7 +286,7 @@ LL | type _T21 = dyn Obj + _5;
286286
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
287287

288288
error[E0225]: only auto traits can be used as additional traits in a trait object
289-
--> $DIR/trait-alias-no-duplicates.rs:71:22
289+
--> $DIR/no-duplicates.rs:71:22
290290
|
291291
LL | trait _5 = Obj + Send;
292292
| --- first non-auto trait
@@ -300,7 +300,7 @@ LL | type _T22 = dyn _5 + Obj;
300300
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
301301

302302
error[E0225]: only auto traits can be used as additional traits in a trait object
303-
--> $DIR/trait-alias-no-duplicates.rs:74:36
303+
--> $DIR/no-duplicates.rs:74:36
304304
|
305305
LL | trait _5 = Obj + Send;
306306
| --- first non-auto trait
@@ -314,7 +314,7 @@ LL | type _T23 = dyn _5 + Send + Sync + Obj;
314314
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
315315

316316
error[E0225]: only auto traits can be used as additional traits in a trait object
317-
--> $DIR/trait-alias-no-duplicates.rs:81:17
317+
--> $DIR/no-duplicates.rs:81:17
318318
|
319319
LL | trait _5 = Obj + Send;
320320
| ---
@@ -337,7 +337,7 @@ LL | type _T30 = dyn _6;
337337
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
338338

339339
error[E0225]: only auto traits can be used as additional traits in a trait object
340-
--> $DIR/trait-alias-no-duplicates.rs:84:17
340+
--> $DIR/no-duplicates.rs:84:17
341341
|
342342
LL | trait _5 = Obj + Send;
343343
| ---
@@ -360,7 +360,7 @@ LL | type _T31 = dyn _6 + Send;
360360
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
361361

362362
error[E0225]: only auto traits can be used as additional traits in a trait object
363-
--> $DIR/trait-alias-no-duplicates.rs:87:24
363+
--> $DIR/no-duplicates.rs:87:24
364364
|
365365
LL | trait _5 = Obj + Send;
366366
| ---
@@ -383,7 +383,7 @@ LL | type _T32 = dyn Send + _6;
383383
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
384384

385385
error[E0225]: only auto traits can be used as additional traits in a trait object
386-
--> $DIR/trait-alias-no-duplicates.rs:95:22
386+
--> $DIR/no-duplicates.rs:95:22
387387
|
388388
LL | trait _5 = Obj + Send;
389389
| --- first non-auto trait
@@ -402,7 +402,7 @@ LL | type _T40 = dyn _8 + Obj;
402402
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
403403

404404
error[E0225]: only auto traits can be used as additional traits in a trait object
405-
--> $DIR/trait-alias-no-duplicates.rs:98:23
405+
--> $DIR/no-duplicates.rs:98:23
406406
|
407407
LL | trait _5 = Obj + Send;
408408
| --- additional non-auto trait
@@ -421,7 +421,7 @@ LL | type _T41 = dyn Obj + _8;
421421
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
422422

423423
error[E0225]: only auto traits can be used as additional traits in a trait object
424-
--> $DIR/trait-alias-no-duplicates.rs:101:22
424+
--> $DIR/no-duplicates.rs:101:22
425425
|
426426
LL | trait _3 = Obj;
427427
| --- additional non-auto trait
@@ -445,7 +445,7 @@ LL | type _T42 = dyn _8 + _4;
445445
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
446446

447447
error[E0225]: only auto traits can be used as additional traits in a trait object
448-
--> $DIR/trait-alias-no-duplicates.rs:104:22
448+
--> $DIR/no-duplicates.rs:104:22
449449
|
450450
LL | trait _3 = Obj;
451451
| --- first non-auto trait
@@ -469,7 +469,7 @@ LL | type _T43 = dyn _4 + _8;
469469
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
470470

471471
error[E0225]: only auto traits can be used as additional traits in a trait object
472-
--> $DIR/trait-alias-no-duplicates.rs:107:36
472+
--> $DIR/no-duplicates.rs:107:36
473473
|
474474
LL | trait _3 = Obj;
475475
| --- first non-auto trait
@@ -493,7 +493,7 @@ LL | type _T44 = dyn _4 + Send + Sync + _8;
493493
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
494494

495495
error[E0225]: only auto traits can be used as additional traits in a trait object
496-
--> $DIR/trait-alias-no-duplicates.rs:117:22
496+
--> $DIR/no-duplicates.rs:117:22
497497
|
498498
LL | trait _9 = for<'a> ObjL<'a>;
499499
| ---------------- first non-auto trait
@@ -508,7 +508,7 @@ LL | type _T50 = dyn _9 + _10;
508508
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
509509

510510
error[E0225]: only auto traits can be used as additional traits in a trait object
511-
--> $DIR/trait-alias-no-duplicates.rs:123:23
511+
--> $DIR/no-duplicates.rs:123:23
512512
|
513513
LL | trait _11 = ObjT<for<'a> fn(&'a u8)>;
514514
| ------------------------ first non-auto trait

0 commit comments

Comments
 (0)