rust/tests/crashes/124340.rs

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

18 lines
382 B
Rust
Raw Normal View History

2024-04-26 15:20:16 +00:00
//@ known-bug: #124340
#![feature(anonymous_lifetime_in_impl_trait)]
trait Producer {
type Output;
fn produce(self) -> Self::Output;
}
trait SomeTrait<'a> {}
fn force_same_lifetime<'a>(_x: &'a i32, _y: impl SomeTrait<'a>) {
unimplemented!()
}
fn foo<'a>(s: &'a i32, producer: impl Producer<Output: SomeTrait<'_>>) {
force_same_lifetime(s, producer.produce());
}