rust/tests/ui/transmute/ambiguity-in-closure-arg.rs
Michael Goulet 870ed4bfa2 Add test
2024-04-25 10:51:54 -04:00

12 lines
440 B
Rust

// Minimized test for <https://github.com/rust-lang/rust/issues/123461>.
struct Unconstrained<T>(T);
fn main() {
unsafe { std::mem::transmute::<_, ()>(|o_b: Unconstrained<_>| {}) };
//~^ ERROR type annotations needed
// We unfortunately don't check `Wf(Unconstrained<_>)`, so we won't
// hit an ambiguity error before checking the transmute. That means
// we still may have inference variables in our transmute src.
}