Fetch diagnostic item later.
This commit is contained in:
parent
0edd4f9499
commit
905b63d64f
1 changed files with 2 additions and 2 deletions
|
@ -756,14 +756,14 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
|
|||
_ => return,
|
||||
}
|
||||
|
||||
let Some(debug) = cx.tcx.get_diagnostic_item(sym::Debug) else { return };
|
||||
|
||||
// Avoid listing trait impls if the trait is allowed.
|
||||
let (level, _) = cx.tcx.lint_level_at_node(MISSING_DEBUG_IMPLEMENTATIONS, item.hir_id());
|
||||
if level == Level::Allow {
|
||||
return;
|
||||
}
|
||||
|
||||
let Some(debug) = cx.tcx.get_diagnostic_item(sym::Debug) else { return };
|
||||
|
||||
let has_impl = cx
|
||||
.tcx
|
||||
.non_blanket_impls_for_ty(debug, cx.tcx.type_of(item.owner_id).instantiate_identity())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue