Skip to content

Commit 5bff842

Browse files
committed
Use type_alias_impl_trait instead of min in compiler and lib
1 parent cfc856a commit 5bff842

File tree

314 files changed

+1192
-2255
lines changed

Some content is hidden

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

314 files changed

+1192
-2255
lines changed

compiler/rustc_data_structures/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
#![feature(iter_map_while)]
2222
#![feature(maybe_uninit_uninit_array)]
2323
#![feature(min_specialization)]
24-
#![feature(min_type_alias_impl_trait)]
24+
#![cfg_attr(bootstrap, feature(min_type_alias_impl_trait))]
25+
#![cfg_attr(not(bootstrap), feature(type_alias_impl_trait))]
2526
#![feature(new_uninit)]
2627
#![feature(nll)]
2728
#![feature(once_cell)]

compiler/rustc_feature/src/active.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ declare_features! (
489489
(active, async_closure, "1.37.0", Some(62290), None),
490490

491491
/// Allows `impl Trait` to be used inside type aliases (RFC 2515).
492-
(incomplete, type_alias_impl_trait, "1.38.0", Some(63063), None),
492+
(active, type_alias_impl_trait, "1.38.0", Some(63063), None),
493493

494494
/// Allows the definition of `const extern fn` and `const unsafe extern fn`.
495495
(active, const_extern_fn, "1.40.0", Some(64926), None),

library/alloc/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@
141141
#![feature(alloc_layout_extra)]
142142
#![feature(trusted_random_access)]
143143
#![feature(try_trait_v2)]
144-
#![feature(min_type_alias_impl_trait)]
144+
#![cfg_attr(bootstrap, feature(min_type_alias_impl_trait))]
145+
#![cfg_attr(not(bootstrap), feature(type_alias_impl_trait))]
145146
#![feature(associated_type_bounds)]
146147
#![feature(slice_group_by)]
147148
#![feature(decl_macro)]

src/test/ui/associated-type-bounds/duplicate.full_tait.stderr

+178-187
Large diffs are not rendered by default.

src/test/ui/associated-type-bounds/duplicate.min_tait.stderr

+177-177
Large diffs are not rendered by default.

src/test/ui/associated-type-bounds/duplicate.rs

+189-70
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,146 @@
22
// revisions: min_tait full_tait
33
#![feature(min_type_alias_impl_trait)]
44
#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
5-
//[full_tait]~^ WARN incomplete
65
#![feature(untagged_unions)]
76

87
use std::iter;
98

10-
struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
11-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
12-
struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
13-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
14-
struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
15-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
16-
struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
17-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
18-
struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
19-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
20-
struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
21-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
9+
struct SI1<T: Iterator<Item: Copy, Item: Send>> {
10+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
11+
f: T,
12+
}
13+
struct SI2<T: Iterator<Item: Copy, Item: Copy>> {
14+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
15+
f: T,
16+
}
17+
struct SI3<T: Iterator<Item: 'static, Item: 'static>> {
18+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
19+
f: T,
20+
}
21+
struct SW1<T>
22+
where
23+
T: Iterator<Item: Copy, Item: Send>,
24+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
25+
{
26+
f: T,
27+
}
28+
struct SW2<T>
29+
where
30+
T: Iterator<Item: Copy, Item: Copy>,
31+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
32+
{
33+
f: T,
34+
}
35+
struct SW3<T>
36+
where
37+
T: Iterator<Item: 'static, Item: 'static>,
38+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
39+
{
40+
f: T,
41+
}
2242

23-
enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) }
24-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
25-
enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) }
26-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
27-
enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) }
28-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
29-
enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) }
30-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
31-
enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) }
32-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
33-
enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) }
34-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
43+
enum EI1<T: Iterator<Item: Copy, Item: Send>> {
44+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
45+
V(T),
46+
}
47+
enum EI2<T: Iterator<Item: Copy, Item: Copy>> {
48+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
49+
V(T),
50+
}
51+
enum EI3<T: Iterator<Item: 'static, Item: 'static>> {
52+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
53+
V(T),
54+
}
55+
enum EW1<T>
56+
where
57+
T: Iterator<Item: Copy, Item: Send>,
58+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
59+
{
60+
V(T),
61+
}
62+
enum EW2<T>
63+
where
64+
T: Iterator<Item: Copy, Item: Copy>,
65+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
66+
{
67+
V(T),
68+
}
69+
enum EW3<T>
70+
where
71+
T: Iterator<Item: 'static, Item: 'static>,
72+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
73+
{
74+
V(T),
75+
}
3576

36-
union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
37-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
38-
union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
39-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
40-
union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
41-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
42-
union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
43-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
44-
union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
45-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
46-
union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
47-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
77+
union UI1<T: Iterator<Item: Copy, Item: Send>> {
78+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
79+
f: T,
80+
}
81+
union UI2<T: Iterator<Item: Copy, Item: Copy>> {
82+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
83+
f: T,
84+
}
85+
union UI3<T: Iterator<Item: 'static, Item: 'static>> {
86+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
87+
f: T,
88+
}
89+
union UW1<T>
90+
where
91+
T: Iterator<Item: Copy, Item: Send>,
92+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
93+
{
94+
f: T,
95+
}
96+
union UW2<T>
97+
where
98+
T: Iterator<Item: Copy, Item: Copy>,
99+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
100+
{
101+
f: T,
102+
}
103+
union UW3<T>
104+
where
105+
T: Iterator<Item: 'static, Item: 'static>,
106+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
107+
{
108+
f: T,
109+
}
48110

49111
fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
50112
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
51113
fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
52114
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
53115
fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
54116
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
55-
fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {}
56-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
57-
fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {}
58-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
59-
fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {}
60-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
117+
fn FW1<T>()
118+
where
119+
T: Iterator<Item: Copy, Item: Send>,
120+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
121+
{
122+
}
123+
fn FW2<T>()
124+
where
125+
T: Iterator<Item: Copy, Item: Copy>,
126+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
127+
{
128+
}
129+
fn FW3<T>()
130+
where
131+
T: Iterator<Item: 'static, Item: 'static>,
132+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
133+
{
134+
}
61135

62-
fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() }
63-
fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() }
64-
fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() }
136+
fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
137+
iter::empty()
138+
}
139+
fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
140+
iter::empty()
141+
}
142+
fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
143+
iter::empty()
144+
}
65145
fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
66146
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
67147
fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
@@ -75,12 +155,21 @@ type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
75155
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
76156
type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
77157
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
78-
type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T;
158+
type TAW1<T>
159+
where
160+
T: Iterator<Item: Copy, Item: Send>,
79161
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
80-
type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T;
162+
= T;
163+
type TAW2<T>
164+
where
165+
T: Iterator<Item: Copy, Item: Copy>,
81166
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
82-
type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
167+
= T;
168+
type TAW3<T>
169+
where
170+
T: Iterator<Item: 'static, Item: 'static>,
83171
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
172+
= T;
84173

85174
type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
86175
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
@@ -107,27 +196,57 @@ trait TRS2: Iterator<Item: Copy, Item: Copy> {}
107196
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
108197
trait TRS3: Iterator<Item: 'static, Item: 'static> {}
109198
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
110-
trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
111-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
112-
trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
113-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
114-
trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
115-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
116-
trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
117-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
118-
//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
119-
trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
120-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
121-
//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
122-
trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
123-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
124-
//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
125-
trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
126-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
127-
trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
128-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
129-
trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
130-
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
199+
trait TRW1<T>
200+
where
201+
T: Iterator<Item: Copy, Item: Send>,
202+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
203+
{
204+
}
205+
trait TRW2<T>
206+
where
207+
T: Iterator<Item: Copy, Item: Copy>,
208+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
209+
{
210+
}
211+
trait TRW3<T>
212+
where
213+
T: Iterator<Item: 'static, Item: 'static>,
214+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
215+
{
216+
}
217+
trait TRSW1
218+
where
219+
Self: Iterator<Item: Copy, Item: Send>,
220+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
221+
//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
222+
{
223+
}
224+
trait TRSW2
225+
where
226+
Self: Iterator<Item: Copy, Item: Copy>,
227+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
228+
//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
229+
{
230+
}
231+
trait TRSW3
232+
where
233+
Self: Iterator<Item: 'static, Item: 'static>,
234+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
235+
//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
236+
{
237+
}
238+
trait TRA1 {
239+
type A: Iterator<Item: Copy, Item: Send>;
240+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
241+
}
242+
trait TRA2 {
243+
type A: Iterator<Item: Copy, Item: Copy>;
244+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
245+
}
246+
trait TRA3 {
247+
type A: Iterator<Item: 'static, Item: 'static>;
248+
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
249+
}
131250

132251
type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
133252
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]

src/test/ui/associated-type-bounds/trait-alias-impl-trait.full_tait.stderr

-11
This file was deleted.

0 commit comments

Comments
 (0)