2024-03-29 18:21:25 -05:00
|
|
|
//@ known-bug: #123141
|
2024-05-29 11:06:50 -05:00
|
|
|
|
|
|
|
trait Trait {
|
|
|
|
fn next(self) -> Self::Item;
|
|
|
|
type Item;
|
2024-03-29 18:21:25 -05:00
|
|
|
}
|
|
|
|
|
2024-05-29 11:06:50 -05:00
|
|
|
struct Foo<T: ?Sized>(T);
|
2024-03-29 18:21:25 -05:00
|
|
|
|
2024-05-29 11:06:50 -05:00
|
|
|
impl<T: ?Sized, U> Trait for Foo<U> {
|
|
|
|
type Item = Foo<T>;
|
|
|
|
fn next(self) -> Self::Item {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
}
|
2024-03-29 18:21:25 -05:00
|
|
|
|
2024-05-29 11:06:50 -05:00
|
|
|
fn opaque() -> impl Trait {
|
|
|
|
Foo::<_>(10_u32)
|
2024-03-29 18:21:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2024-05-29 11:06:50 -05:00
|
|
|
opaque().next();
|
2024-03-29 18:21:25 -05:00
|
|
|
}
|