-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 #58865 - dlrobertson:fix-varargs, r=alexreg
Fix C-variadic function printing There is no longer a need to append the string `", ..."` to a functions args as `...` is parsed as an argument and will appear in the functions arguments. r? @alexreg cc @alexcrichton Fixes: #58853
- Loading branch information
Showing
2 changed files
with
15 additions
and
3 deletions.
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,15 @@ | ||
// Check that `fn foo(x: i32, ...)` does not print as `fn foo(x: i32, ..., ...)`. | ||
// See issue #58853. | ||
|
||
// pp-exact | ||
#![feature(c_variadic)] | ||
|
||
extern "C" { | ||
pub fn foo(x: i32, ...); | ||
} | ||
|
||
pub unsafe extern "C" fn bar(_: i32, mut ap: ...) -> usize { | ||
ap.arg::<usize>() | ||
} | ||
|
||
fn main() {} |