rust/tests/crashes/124340.rs

18 lines
382 B
Rust
Raw Normal View History

2024-04-26 10:20:16 -05: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());
}