about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/nonstandard_style.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-09-20 05:31:54 +0000
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-09-21 05:24:26 +0000
commit43ede7331d6b05f6e3c1b215694db3137c8583c2 (patch)
tree300c409a3a06ebcff35adc911aadb6742c3e121b /compiler/rustc_lint/src/nonstandard_style.rs
parentc0838c8ebec23fb87855bb6de3a287981cb1df98 (diff)
downloadrust-43ede7331d6b05f6e3c1b215694db3137c8583c2.tar.gz
rust-43ede7331d6b05f6e3c1b215694db3137c8583c2.zip
Explain why non_snake_case is skipped for binary crates
Diffstat (limited to 'compiler/rustc_lint/src/nonstandard_style.rs')
-rw-r--r--compiler/rustc_lint/src/nonstandard_style.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs
index d81052b5e24..ce4ee45c485 100644
--- a/compiler/rustc_lint/src/nonstandard_style.rs
+++ b/compiler/rustc_lint/src/nonstandard_style.rs
@@ -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;
         }