rust/tests/crashes/131373.rs

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

34 lines
616 B
Rust
Raw Normal View History

2024-10-09 08:34:45 -05:00
//@ known-bug: #131373
trait LockReference: 'static {
type Ref<'a>;
}
struct SliceRef<'a, T: ?Sized> {
_x: &'a T,
}
impl<'a, T: ?Sized, SR: LockReference> IntoIterator for SliceRef<'a, T>
where
&'a T: IntoIterator<Item = &'a SR>,
{
type Item = SR::Ref<'a>;
type IntoIter = std::iter::Map<<&'a T as IntoIterator>::IntoIter,
for<'c> fn(&'c SR) -> SR::Ref<'c>>;
fn into_iter(self) -> Self::IntoIter {
loop {}
}
}
impl LockReference for () {
type Ref<'a> = ();
}
fn locked() -> SliceRef<'static, [()]> {
loop {}
}
fn main() {
let _ = locked().into_iter();
}