Closed
Description
Defining a pub
static inside a private module like this
mod test {
#[no_mangle]
pub static FOO: usize = 1;
}
yields the following warning:
warning: static is marked #[no_mangle], but not exported
--> src/main.rs:7:5
|
7 | pub static FOO: usize = 1;
| -^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: try making it public: `pub`
|
= note: #[warn(private_no_mangle_statics)] on by default
The suggestion wrongly tells us to add a pub
to the already public FOO
.
(playpen)