Skip to content

Commit 43ede73

Browse files
committed
Explain why non_snake_case is skipped for binary crates
1 parent c0838c8 commit 43ede73

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

+3
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
332332
return;
333333
}
334334

335+
// Issue #45127: don't enforce `snake_case` for binary crates as binaries are not intended
336+
// to be distributed and depended on like libraries. The lint is not suppressed for cdylib
337+
// or staticlib because it's not clear what the desired lint behavior for those are.
335338
if cx.tcx.crate_types().iter().all(|&crate_type| crate_type == CrateType::Executable) {
336339
return;
337340
}

0 commit comments

Comments
 (0)