forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63459 - eddyb:issue-63430, r=petrochenkov
syntax: account for CVarArgs being in the argument list. Fixes rust-lang#63430 by testing for `1` argument (the `CVarArgs` itself) instead of `0`. Note that the error has basically been impossible to trigger since the change that caused rust-lang#63430, so perhaps we need an audit of untested errors. Also, this check probably belongs in AST validation/HIR lowering, but I'd rather fix it in place for now. r? @petrochenkov cc @dlrobertson
- Loading branch information
Showing
3 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
extern { | ||
fn foo(...); | ||
//~^ ERROR C-variadic function must be declared with at least one named argument | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: C-variadic function must be declared with at least one named argument | ||
--> $DIR/variadic-ffi-no-fixed-args.rs:2:11 | ||
| | ||
LL | fn foo(...); | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
|