Skip to content

Commit e51bb0e

Browse files
committed
Add test for ICE 6793
1 parent bdeec5d commit e51bb0e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/ui/crashes/ice-6793.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//! This is a reproducer for the ICE 6793: https://github.com/rust-lang/rust-clippy/issues/6793.
2+
//! The ICE is caused by using `TyCtxt::type_of(assoc_type_id)`, which is the same as the ICE 6792.
3+
4+
trait Trait {
5+
type Ty: 'static + Clone;
6+
7+
fn broken() -> Self::Ty;
8+
}
9+
10+
#[derive(Clone)]
11+
struct MyType {
12+
x: i32,
13+
}
14+
15+
impl Trait for MyType {
16+
type Ty = MyType;
17+
18+
fn broken() -> Self::Ty {
19+
Self::Ty { x: 1 }
20+
}
21+
}
22+
23+
fn main() {}

0 commit comments

Comments
 (0)