Skip to content

Commit 1318d94

Browse files
authored
Rollup merge of #96603 - Alexendoo:const-generics-tests, r=Mark-Simulacrum
Enable full revision in const generics ui tests The ICEs no longer occur since #95776 so the revisions can be reenabled Also adds some regression tests for issues that no longer ICE because of it closes #77357 closes #78180 closes #83993
2 parents 4c60a0e + 0571157 commit 1318d94

8 files changed

+291
-71
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
2+
--> $DIR/const-arg-in-const-arg.rs:18:23
3+
|
4+
LL | let _: [u8; faz::<'a>(&())];
5+
| ^^
6+
|
7+
note: the late bound lifetime parameter is introduced here
8+
--> $DIR/const-arg-in-const-arg.rs:8:14
9+
|
10+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
11+
| ^^
12+
13+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
14+
--> $DIR/const-arg-in-const-arg.rs:21:23
15+
|
16+
LL | let _: [u8; faz::<'b>(&())];
17+
| ^^
18+
|
19+
note: the late bound lifetime parameter is introduced here
20+
--> $DIR/const-arg-in-const-arg.rs:8:14
21+
|
22+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
23+
| ^^
24+
25+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
26+
--> $DIR/const-arg-in-const-arg.rs:30:23
27+
|
28+
LL | let _ = [0; faz::<'a>(&())];
29+
| ^^
30+
|
31+
note: the late bound lifetime parameter is introduced here
32+
--> $DIR/const-arg-in-const-arg.rs:8:14
33+
|
34+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
35+
| ^^
36+
37+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
38+
--> $DIR/const-arg-in-const-arg.rs:33:23
39+
|
40+
LL | let _ = [0; faz::<'b>(&())];
41+
| ^^
42+
|
43+
note: the late bound lifetime parameter is introduced here
44+
--> $DIR/const-arg-in-const-arg.rs:8:14
45+
|
46+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
47+
| ^^
48+
49+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
50+
--> $DIR/const-arg-in-const-arg.rs:41:24
51+
|
52+
LL | let _: Foo<{ faz::<'a>(&()) }>;
53+
| ^^
54+
|
55+
note: the late bound lifetime parameter is introduced here
56+
--> $DIR/const-arg-in-const-arg.rs:8:14
57+
|
58+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
59+
| ^^
60+
61+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
62+
--> $DIR/const-arg-in-const-arg.rs:44:24
63+
|
64+
LL | let _: Foo<{ faz::<'b>(&()) }>;
65+
| ^^
66+
|
67+
note: the late bound lifetime parameter is introduced here
68+
--> $DIR/const-arg-in-const-arg.rs:8:14
69+
|
70+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
71+
| ^^
72+
73+
error: unconstrained generic constant
74+
--> $DIR/const-arg-in-const-arg.rs:13:12
75+
|
76+
LL | let _: [u8; foo::<T>()];
77+
| ^^^^^^^^^^^^^^^^
78+
|
79+
= help: try adding a `where` bound using this expression: `where [(); foo::<T>()]:`
80+
81+
error: unconstrained generic constant
82+
--> $DIR/const-arg-in-const-arg.rs:15:12
83+
|
84+
LL | let _: [u8; bar::<N>()];
85+
| ^^^^^^^^^^^^^^^^
86+
|
87+
= help: try adding a `where` bound using this expression: `where [(); bar::<N>()]:`
88+
89+
error: unconstrained generic constant
90+
--> $DIR/const-arg-in-const-arg.rs:36:12
91+
|
92+
LL | let _: Foo<{ foo::<T>() }>;
93+
| ^^^^^^^^^^^^^^^^^^^
94+
|
95+
= help: try adding a `where` bound using this expression: `where [(); { foo::<T>() }]:`
96+
97+
error: unconstrained generic constant
98+
--> $DIR/const-arg-in-const-arg.rs:38:12
99+
|
100+
LL | let _: Foo<{ bar::<N>() }>;
101+
| ^^^^^^^^^^^^^^^^^^^
102+
|
103+
= help: try adding a `where` bound using this expression: `where [(); { bar::<N>() }]:`
104+
105+
error: unconstrained generic constant
106+
--> $DIR/const-arg-in-const-arg.rs:25:17
107+
|
108+
LL | let _ = [0; foo::<T>()];
109+
| ^^^^^^^^^^
110+
|
111+
= help: try adding a `where` bound using this expression: `where [(); foo::<T>()]:`
112+
113+
error: unconstrained generic constant
114+
--> $DIR/const-arg-in-const-arg.rs:27:17
115+
|
116+
LL | let _ = [0; bar::<N>()];
117+
| ^^^^^^^^^^
118+
|
119+
= help: try adding a `where` bound using this expression: `where [(); bar::<N>()]:`
120+
121+
error: unconstrained generic constant
122+
--> $DIR/const-arg-in-const-arg.rs:47:19
123+
|
124+
LL | let _ = Foo::<{ foo::<T>() }>;
125+
| ^^^^^^^^^^^^^^
126+
|
127+
= help: try adding a `where` bound using this expression: `where [(); { foo::<T>() }]:`
128+
129+
error: unconstrained generic constant
130+
--> $DIR/const-arg-in-const-arg.rs:49:19
131+
|
132+
LL | let _ = Foo::<{ bar::<N>() }>;
133+
| ^^^^^^^^^^^^^^
134+
|
135+
= help: try adding a `where` bound using this expression: `where [(); { bar::<N>() }]:`
136+
137+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
138+
--> $DIR/const-arg-in-const-arg.rs:52:27
139+
|
140+
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
141+
| ^^
142+
|
143+
note: the late bound lifetime parameter is introduced here
144+
--> $DIR/const-arg-in-const-arg.rs:8:14
145+
|
146+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
147+
| ^^
148+
149+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
150+
--> $DIR/const-arg-in-const-arg.rs:55:27
151+
|
152+
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
153+
| ^^
154+
|
155+
note: the late bound lifetime parameter is introduced here
156+
--> $DIR/const-arg-in-const-arg.rs:8:14
157+
|
158+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
159+
| ^^
160+
161+
error: aborting due to 16 previous errors
162+

0 commit comments

Comments
 (0)