Don't lint snake-case on executable crate name
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
This commit is contained in:
parent
ef324565d0
commit
bf8756d2dd
17 changed files with 123 additions and 15 deletions
|
@ -10,6 +10,7 @@ use rustc_hir::def::{DefKind, Res};
|
|||
use rustc_hir::intravisit::FnKind;
|
||||
use rustc_hir::{GenericParamKind, PatKind};
|
||||
use rustc_middle::ty;
|
||||
use rustc_session::config::CrateType;
|
||||
use rustc_span::def_id::LocalDefId;
|
||||
use rustc_span::symbol::{sym, Ident};
|
||||
use rustc_span::{BytePos, Span};
|
||||
|
@ -366,7 +367,9 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
|
|||
})
|
||||
};
|
||||
|
||||
if let Some(ident) = &crate_ident {
|
||||
if let Some(ident) = &crate_ident
|
||||
&& cx.tcx.crate_types().iter().all(|&crate_type| crate_type != CrateType::Executable)
|
||||
{
|
||||
self.check_snake_case(cx, "crate", ident);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue