diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-02-11 22:10:35 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-02-11 22:10:35 -0800 |
| commit | f7cabc6550f23d8a761abf737763a0375a0ac41a (patch) | |
| tree | b4b2439df39240ecec0ec0a65ef4c6d42395b2e1 /src/test/ui/invalid-variadic-function.rs | |
| parent | d0f1f4281632386ab0e3f35eed87fac0e5b2d771 (diff) | |
Continue parsing function after finding `...` arg
When encountering a variadic argument in a function definition that doesn't accept it, if immediately after there's a closing paren, continue parsing as normal. Otherwise keep current behavior of emitting error and stopping.
Diffstat (limited to 'src/test/ui/invalid-variadic-function.rs')
| -rw-r--r-- | src/test/ui/invalid-variadic-function.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/invalid-variadic-function.rs b/src/test/ui/invalid-variadic-function.rs new file mode 100644 index 00000000000..3d421e00b08 --- /dev/null +++ b/src/test/ui/invalid-variadic-function.rs @@ -0,0 +1,13 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern "C" fn foo(x: u8, ...); +//~^ ERROR only foreign functions are allowed to be variadic +//~| ERROR expected one of `->`, `where`, or `{`, found `;` |
