summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issue-99073-2.rs
blob: 14ac688806bda2a6da34b5bc1bbe90c182125ef2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
        println!("{i}");
    };
    if recurse {
        f();
    }
    t
}