Closed
Description
#[no_mangle]
pub static this_symbol_is_required_to_exist: i32 = 1;
fn main() {
}
Yields compiler warning:
warning: static constant `this_symbol_is_required_to_exist` should have an upper case name such as `THIS_SYMBOL_IS_REQUIRED_TO_EXIST`, #[warn(non_upper_case_globals)] on by default
--> <anon>:2:1
|
2 | pub static this_symbol_is_required_to_exist: i32 = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think #[no_mangle]
is a good hint that the symbol's name (incl. capitalization) is important enough that stylistic lints should be disabled for it. The lint already ignores functions in extern "C" {}
blocks, for example:
extern "C" {
pub fn This_IS_WaCkYcapitalization();
}