Skip to content

Need more helpful warning when "pub extern" function is not exported via "pub use" #49238

Open
@federicomenaquintero

Description

@federicomenaquintero

I'm creating a bunch of #[no_mangle] pub extern fn that will be callable from C code. Sometimes I forget to put them in my toplevel lib.rs as pub use. This is the warning I get:

warning: function is marked #[no_mangle], but not exported
   --> src/state.rs:436:1
    |
436 |   pub extern "C" fn rsvg_state_rust_parse_style_pair(
    |   ^
    |   |
    |  _help: try making it public: `pub `

At first sight, that function is already pub! The warning should say that I need to export it from the crate via pub use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler 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