-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.
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();
}
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.