rust/tests/ui/transmute/ambiguity-in-closure-arg.rs

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

12 lines
440 B
Rust
Raw Normal View History

2024-04-15 20:13:31 -04:00
// 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.
}