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