Skip to content

Commit 631aed8

Browse files
authored
Rollup merge of #101451 - cjgillot:test-100521, r=TaKO8Ki
Add incremental test for changing struct name in assoc type. The ICE appears on beta and is fixed on nightly. Fixes #100521
2 parents 78a891d + fdf56cf commit 631aed8

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// revisions: rpass1 rpass2
2+
3+
pub fn foo() {
4+
bar();
5+
baz::<()>();
6+
}
7+
8+
fn bar()
9+
where
10+
<() as Table>::AllColumns:,
11+
{
12+
}
13+
14+
fn baz<W>()
15+
where
16+
W: AsQuery,
17+
<W as AsQuery>::Query:,
18+
{
19+
}
20+
21+
trait AsQuery {
22+
type Query;
23+
}
24+
25+
trait UnimplementedTrait {}
26+
27+
impl<T> AsQuery for T
28+
where
29+
T: UnimplementedTrait,
30+
{
31+
type Query = ();
32+
}
33+
34+
struct Wrapper<Expr>(Expr);
35+
36+
impl<Ret> AsQuery for Wrapper<Ret> {
37+
type Query = ();
38+
}
39+
40+
impl AsQuery for ()
41+
where
42+
Wrapper<<() as Table>::AllColumns>: AsQuery,
43+
{
44+
type Query = ();
45+
}
46+
47+
trait Table {
48+
type AllColumns;
49+
}
50+
51+
#[cfg(rpass1)]
52+
impl Table for () {
53+
type AllColumns = Checksum1;
54+
}
55+
#[cfg(rpass1)]
56+
struct Checksum1;
57+
58+
#[cfg(rpass2)]
59+
impl Table for () {
60+
type AllColumns = Checksum2;
61+
}
62+
#[cfg(rpass2)]
63+
struct Checksum2;
64+
65+
fn main() {}

0 commit comments

Comments
 (0)