Skip to content

C-variadic function definitions stabilization allows ... without pattern with immediate FCW #160109

Description

@traviscross

In #155697, we stabilized C-variadic function definitions (and C-variadic function declarations in traits).

While reviewing and revising the Reference PR for this, rust-lang/reference#2177, I noticed that we're stabilizing allowance of a behavior that we document as disallowed (with an immediate FCW against it). Prior to the stabilization, we gave a hard error for both of:

unsafe extern "C" fn f(...) {} // ERROR.

trait Tr {
    unsafe extern "C" fn f(...); // ERROR.
}

After the stabilization, these are both accepted:

#![allow(varargs_without_pattern)]
unsafe extern "C" fn f(...) {} // OK.
#![allow(varargs_without_pattern)]
trait Tr {
    unsafe extern "C" fn f(...); // OK.
}

That is, we're accepting ... in parameter position without a preceding pattern (with a deny-by-default FCW).

This is a bit unusual for us. Normally we don't stabilize new behavior only to issue an immediately FCW. Presumably we want to ask for this to continue to give a hard error (semantically — this was already accepted in parsing).

cc @folkertdev @rust-lang/lang-docs @rust-lang/lang

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.I-lang-nominatedNominated for discussion during a lang team meeting.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.P-lang-drag-1Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-langT-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions