Skip to content

Delegation: It's impossible to reuse foreign fns #127412

Closed
@fmease

Description

@fmease

Example:

#![feature(fn_delegation)]

extern "C" {
    fn f();
}

reuse f as g;
//~^ ERROR call to unsafe function `f` is unsafe and requires unsafe function or block

The synthesized fn g ought to be marked unsafe as f is implicitly unsafe1 but that doesn't happen.

Footnotes

  1. Unless marked safe under feature unsafe_extern_blocks, these are possible to reuse for obvious reasons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-fn_delegation`#![feature(fn_delegation)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions