We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf8756d commit d363db7Copy full SHA for d363db7
compiler/rustc_lint/src/nonstandard_style.rs
@@ -332,6 +332,10 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
332
return;
333
}
334
335
+ if cx.tcx.crate_types().iter().all(|&crate_type| crate_type == CrateType::Executable) {
336
+ return;
337
+ }
338
+
339
let crate_ident = if let Some(name) = &cx.tcx.sess.opts.crate_name {
340
Some(Ident::from_str(name))
341
} else {
@@ -367,9 +371,7 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
367
371
})
368
372
};
369
373
370
- if let Some(ident) = &crate_ident
- && cx.tcx.crate_types().iter().all(|&crate_type| crate_type != CrateType::Executable)
- {
374
+ if let Some(ident) = &crate_ident {
375
self.check_snake_case(cx, "crate", ident);
376
377
0 commit comments