Skip to content

Commit

Permalink
Explain why non_snake_case is skipped for binary crates
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Sep 21, 2024
1 parent c0838c8 commit 43ede73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_lint/src/nonstandard_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
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) {
return;
}
Expand Down

0 comments on commit 43ede73

Please sign in to comment.