-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-c_variadic`#![feature(c_variadic)]``#![feature(c_variadic)]`F-fn_delegation`#![feature(fn_delegation)]``#![feature(fn_delegation)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.This issue requires the use of incomplete features.
Description
While the following code gets rejected:
#![feature(c_variadic)]
struct S;
impl S {
unsafe extern "C" fn f(...) {}
//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
}
The code below doesn't:
#![feature(c_variadic, fn_delegation)]
struct S;
unsafe extern "C" fn f(...) {}
impl S {
reuse f;
}
And yes, S::f
does "appear to behave variadic". I'm not a C-FFI or ABI expert, so I guess it's for a very good reason that variadic associated functions generally get rejected.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-c_variadic`#![feature(c_variadic)]``#![feature(c_variadic)]`F-fn_delegation`#![feature(fn_delegation)]``#![feature(fn_delegation)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.This issue requires the use of incomplete features.