rust/tests/crashes/123141.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
324 B
Rust
Raw Normal View History

//@ known-bug: #123141
2024-05-29 16:06:50 +00:00
trait Trait {
fn next(self) -> Self::Item;
type Item;
}
2024-05-29 16:06:50 +00:00
struct Foo<T: ?Sized>(T);
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-05-29 16:06:50 +00:00
fn opaque() -> impl Trait {
Foo::<_>(10_u32)
}
fn main() {
2024-05-29 16:06:50 +00:00
opaque().next();
}