summary refs log tree commit diff
path: root/tests/crashes/123141.rs
blob: 07181387e0450fee646f1ff2386eb4f6e58c729f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ known-bug: #123141

trait Trait {
    fn next(self) -> Self::Item;
    type Item;
}

struct Foo<T: ?Sized>(T);

impl<T: ?Sized, U> Trait for Foo<U> {
    type Item = Foo<T>;
    fn next(self) -> Self::Item {
        loop {}
    }
}

fn opaque() -> impl Trait {
    Foo::<_>(10_u32)
}

fn main() {
    opaque().next();
}