about summary refs log tree commit diff
path: root/tests/ui/impl-trait/issues/issue-99073-2.rs
blob: bfb8850857de2445c6c259ba54195813d292418b (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 expected generic type parameter, found `i32`
        println!("{i}");
    };
    if recurse {
        f();
    }
    t
}