summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issue-99073-2.rs
blob: 37ea211bec368d02883f6c7d9fa28bff0dc52fa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::fmt::Display;

fn main() {
    test("hi", true);
}

fn test<T: Display>(t: T, recurse: bool) -> impl Display {
    let f = || {
        let i: u32 = test::<i32>(-1, false);
        //~^ ERROR concrete type differs from previous defining opaque type use
        //~| ERROR expected generic type parameter, found `i32`
        println!("{i}");
    };
    if recurse {
        f();
    }
    t
}