2022-07-16 15:08:04 -05:00
|
|
|
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);
|
2022-07-09 02:11:03 -05:00
|
|
|
//~^ ERROR concrete type differs from previous defining opaque type use
|
2023-07-21 05:27:41 -05:00
|
|
|
//~| ERROR expected generic type parameter, found `i32`
|
2022-07-16 15:08:04 -05:00
|
|
|
println!("{i}");
|
|
|
|
};
|
|
|
|
if recurse {
|
|
|
|
f();
|
|
|
|
}
|
|
|
|
t
|
|
|
|
}
|