summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/rpit/non-defining-use.rs
blob: 255a8929a87867cde1259e895df9eea2056ec15a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Regression test for #111935 that non-defining uses of RPIT result in errors
#![allow(unconditional_recursion)]
fn foo<T>() -> impl Sized {
    let _: () = foo::<u8>(); //~ ERROR expected generic type parameter, found `u8`
}

fn bar<T>(val: T) -> impl Sized {
    let _: u8 = bar(0u8);
    //~^ ERROR concrete type differs from previous defining opaque type use
    //~| ERROR expected generic type parameter, found `u8`
    val
}

fn main() {}