Hoist only-executables check above producing crate ident
This commit is contained in:
parent
bf8756d2dd
commit
d363db71f8
1 changed files with 5 additions and 3 deletions
|
@ -332,6 +332,10 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cx.tcx.crate_types().iter().all(|&crate_type| crate_type == CrateType::Executable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let crate_ident = if let Some(name) = &cx.tcx.sess.opts.crate_name {
|
let crate_ident = if let Some(name) = &cx.tcx.sess.opts.crate_name {
|
||||||
Some(Ident::from_str(name))
|
Some(Ident::from_str(name))
|
||||||
} else {
|
} else {
|
||||||
|
@ -367,9 +371,7 @@ 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);
|
self.check_snake_case(cx, "crate", ident);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue