Skip to content

Commit 64f7ced

Browse files
committed
Derive Default instead of new in applicable lint
1 parent 112f7e9 commit 64f7ced

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/librustc_lint/builtin.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -542,18 +542,13 @@ declare_lint! {
542542
"detects missing implementations of fmt::Debug"
543543
}
544544

545+
#[derive(Default)]
545546
pub struct MissingDebugImplementations {
546547
impling_types: Option<HirIdSet>,
547548
}
548549

549550
impl_lint_pass!(MissingDebugImplementations => [MISSING_DEBUG_IMPLEMENTATIONS]);
550551

551-
impl MissingDebugImplementations {
552-
pub fn new() -> MissingDebugImplementations {
553-
MissingDebugImplementations { impling_types: None }
554-
}
555-
}
556-
557552
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
558553
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
559554
if !cx.access_levels.is_reachable(item.hir_id) {

src/librustc_lint/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ macro_rules! late_lint_passes {
132132
// Depends on access levels
133133
// FIXME: Turn the computation of types which implement Debug into a query
134134
// and change this to a module lint pass
135-
MissingDebugImplementations: MissingDebugImplementations::new(),
135+
MissingDebugImplementations: MissingDebugImplementations::default(),
136136
]);
137137
)
138138
}

0 commit comments

Comments
 (0)