about summary refs log tree commit diff
path: root/tests/crashes/124340.rs
blob: cdf24fa039590c2fbc1f23c1f16755403af2f3c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ 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());
}