0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-28 20:31:43 +01:00
rust/tests/ui/wf/closure-wf.rs
Michael Goulet 870ed4bfa2 Add test
2024-04-25 10:51:54 -04:00

12 lines
296 B
Rust

trait Bound {}
struct NeedsBound<T: Bound>(T);
// Checks that we enforce that closure args are WF.
fn constrain_inner<T, F: for<'a> FnOnce(&'a (), NeedsBound<T>)>(_: T, _: F) {}
fn main() {
constrain_inner(1u32, |&(), _| ());
//~^ ERROR the trait bound `u32: Bound` is not satisfied
}