We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82cd953 commit fd413c2Copy full SHA for fd413c2
compiler/rustc_lint/src/nonstandard_style.rs
@@ -10,6 +10,7 @@ use rustc_hir::def::{DefKind, Res};
10
use rustc_hir::intravisit::FnKind;
11
use rustc_hir::{GenericParamKind, PatKind};
12
use rustc_middle::ty;
13
+use rustc_session::config::CrateType;
14
use rustc_span::def_id::LocalDefId;
15
use rustc_span::symbol::{sym, Ident};
16
use rustc_span::{BytePos, Span};
@@ -366,7 +367,11 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
366
367
})
368
};
369
- if let Some(ident) = &crate_ident {
370
+ if let Some(ident) = &crate_ident
371
+ && cx.tcx.sess.crate_types().iter().all(|&crate_type| {
372
+ crate_type != CrateType::Executable
373
+ })
374
+ {
375
self.check_snake_case(cx, "crate", ident);
376
}
377
0 commit comments