blob: 830ed962a8c4aa10451ff474dbdb54827db6cebf [file] [log] [blame]
#![feature(c_variadic)]
#![crate_type = "lib"]
// Check that `...` in closures is rejected.
const F: extern "C" fn(...) = |_: ...| {};
//~^ ERROR: unexpected `...`
//~| NOTE: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
fn foo() {
let f = |...| {};
//~^ ERROR: unexpected `...`
//~| NOTE: not a valid pattern
//~| NOTE: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
let f = |_: ...| {};
//~^ ERROR: unexpected `...`
//~| NOTE: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
f(1i64)
}