Skip to content

Rust wants me to write pub pub #47565

Closed
Closed
@jD91mZM2

Description

@jD91mZM2

Hi! Another fun error message for you:

warning: function is marked #[no_mangle], but not exported
  --> src/c_api.rs:63:1
   |
63 |   pub extern fn rot26_decrypt_any(input: *const c_char, amount: u32) -> *const c_char {
   |   ^
   |   |
   |  _help: try making it public: `pub `
   | |
64 | |     let input = match unsafe { CStr::from_ptr(input).to_str() } {
65 | |         Ok(input) => input,
66 | |         Err(_) => return ptr::null()
...  |
75 | |     ptr
76 | | }
   | |_^

(The problem is actually that the module is hidden. So I should use pub mod.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions