Skip to content

Commit 1e5f587

Browse files
Add regression test for ICE
1 parent 0676d2e commit 1e5f587

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ revisions: cpass1 cpass2
2+
//@ edition: 2024
3+
// regression test for https://github.com/rust-lang/rust/issues/158093
4+
5+
trait Super {
6+
type Assoc;
7+
}
8+
9+
trait Sub: Super {}
10+
11+
impl<T: ?Sized> Super for T {
12+
type Assoc = i32;
13+
}
14+
15+
fn illegal(x: &dyn Sub<Assoc = impl Sized>) -> &dyn Super<Assoc = impl Sized> {
16+
x
17+
}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)