]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/issue-99073-2.rs
Auto merge of #106171 - compiler-errors:consolidate-extract_callable_info, r=estebank...
[rust.git] / tests / ui / impl-trait / issue-99073-2.rs
1 use std::fmt::Display;
2
3 fn main() {
4     test("hi", true);
5 }
6
7 fn test<T: Display>(t: T, recurse: bool) -> impl Display {
8     let f = || {
9         let i: u32 = test::<i32>(-1, false);
10         //~^ ERROR concrete type differs from previous defining opaque type use
11         println!("{i}");
12     };
13     if recurse {
14         f();
15     }
16     t
17 }