Skip to content

Stripping extern "Rust" from functions #5701

Closed
@Jarcho

Description

@Jarcho

Rustfmt currently strips extern "Rust" from function signatures. e.g formatting extern "Rust" fn foo() {} to fn foo() {}. This seems to be intentional from the current code.

The problem here is this essentially deletes documentation from the code. Given a function such as:

#[no_mangle]
extern "Rust" fn foo() { /* do stuff */ }

With the ABI explicitly added here, it's clear that the odd ABI choice is intentional. Without the explicit ABI, it's unclear whether the choice was intentional, or an ABI was forgotten (e.g. extern "C").

Can't find anything relevant from the style guide about this removal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions