mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Explain why non_snake_case is skipped for binary crates
This commit is contained in:
parent
c0838c8ebe
commit
43ede7331d
@ -332,6 +332,9 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #45127: don't enforce `snake_case` for binary crates as binaries are not intended
|
||||||
|
// to be distributed and depended on like libraries. The lint is not suppressed for cdylib
|
||||||
|
// or staticlib because it's not clear what the desired lint behavior for those are.
|
||||||
if cx.tcx.crate_types().iter().all(|&crate_type| crate_type == CrateType::Executable) {
|
if cx.tcx.crate_types().iter().all(|&crate_type| crate_type == CrateType::Executable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user