Skip to content

Commit 161687a

Browse files
committed
Explain why non_snake_case is skipped for binary crates
1 parent 5793a9e commit 161687a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

Lines changed: 3 additions & 0 deletions
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)