rust/tests/ui/impl-trait/issue-99073-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
322 B
Rust
Raw Permalink Normal View History

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);
2025-04-01 21:48:41 +00:00
//~^ ERROR expected generic type parameter, found `i32`
println!("{i}");
};
if recurse {
f();
}
t
}