]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
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() {} |