Do not run lints that cannot emit

Before this change, adding a lint was a difficult matter
because it always had some overhead involved. This was
because all lints would run, no matter their default level,
or if the user had #![allow]ed them. This PR changes that
This commit is contained in:
blyxyas
2023-11-13 14:35:37 +01:00
parent c926476d01
commit b4da058595
45 changed files with 264 additions and 50 deletions

View File

@@ -1025,8 +1025,8 @@ pub(crate) struct UnusedParens {
parens_in_cast_in_lt: Vec<ast::NodeId>,
}
impl UnusedParens {
pub(crate) fn new() -> Self {
impl Default for UnusedParens {
fpub(crate) fn default() -> Self {
Self { with_self_ty_parens: false, parens_in_cast_in_lt: Vec::new() }
}
}