Skip to content

rust-call call ABI is not feature gated at call-sites #34901

Open
@pnkfelix

Description

@pnkfelix

Note: This may be a feature, not a bug. But I wanted to make the point explicit.

If I make a crate named defs with this:

#![feature(unboxed_closures)]
pub extern "rust-call" fn foo(_: (), _: ()) { println!("defs::foo"); }

and then a bin crate uses with a dependency on defs and this for its main.rs:

extern crate defs;
fn main() {
    println!("Hello");
    defs::foo((), ());
    println!("world!");

}

Compiling the former obviously provides the feature gate it needs to define something with the rust-call ABI.

But compiling the latter does not require any feature gate, even though it is calling something via the rust-call ABI which is not stable.

This may be fine, since the point of origin is gated (apart from problems like #34900). But it seems worth discussion.

Metadata

Metadata

Assignees

Labels

A-stabilityArea: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.F-unboxed_closures`#![feature(unboxed_closures)]`P-mediumMedium priorityT-langRelevant to the language team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions