summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/multiple-defining-usages-in-body.rs
blob: 86661153a0d098a57e985b87256b0eb6e6d3e41a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
trait Trait {}
impl Trait for () {}

fn foo<T: Trait, U: Trait>() -> impl Trait {
    //~^ WARN function cannot return without recursing [unconditional_recursion]
    let a: T = foo::<T, U>();
    loop {}
    let _: T = foo::<U, T>();
    //~^ ERROR concrete type differs from previous defining opaque type use
}

fn main() {}