rust/tests/ui/closures/binder/forbid_ambig_const_infers.rs

10 lines
284 B
Rust

#![feature(generic_arg_infer, closure_lifetime_binder)]
struct Foo<const N: usize>([u32; N]);
fn main() {
let c = for<'a> |b: &'a Foo<_>| -> u32 { b.0[0] };
//~^ ERROR: implicit types in closure signatures are forbidden when `for<...>` is present
c(&Foo([1_u32; 1]));
}