Derive Default instead of new in applicable lint
This commit is contained in:
parent
112f7e9ac5
commit
64f7cede8b
@ -542,18 +542,13 @@ declare_lint! {
|
||||
"detects missing implementations of fmt::Debug"
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MissingDebugImplementations {
|
||||
impling_types: Option<HirIdSet>,
|
||||
}
|
||||
|
||||
impl_lint_pass!(MissingDebugImplementations => [MISSING_DEBUG_IMPLEMENTATIONS]);
|
||||
|
||||
impl MissingDebugImplementations {
|
||||
pub fn new() -> MissingDebugImplementations {
|
||||
MissingDebugImplementations { impling_types: None }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
|
||||
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
|
||||
if !cx.access_levels.is_reachable(item.hir_id) {
|
||||
|
@ -132,7 +132,7 @@ macro_rules! late_lint_passes {
|
||||
// Depends on access levels
|
||||
// FIXME: Turn the computation of types which implement Debug into a query
|
||||
// and change this to a module lint pass
|
||||
MissingDebugImplementations: MissingDebugImplementations::new(),
|
||||
MissingDebugImplementations: MissingDebugImplementations::default(),
|
||||
]);
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user