about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/crashes/ice-6792.rs
blob: 372ce5ac06f3e004246f6ef7c5aec43d8af7c021 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ check-pass
//! This is a reproducer for the ICE 6792: https://github.com/rust-lang/rust-clippy/issues/6792.
//! The ICE is caused by using `TyCtxt::type_of(assoc_type_id)`.

trait Trait {
    type Ty;

    fn broken() -> Self::Ty;
}

struct Foo;

impl Trait for Foo {
    type Ty = Foo;

    fn broken() -> Self::Ty {
        Self::Ty {}
    }
}

fn main() {}