diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-08-03 13:12:58 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-08-04 16:09:14 +0000 |
| commit | 905b63d64f8f91016a7fb0e40f0c0ae4f5e8cc51 (patch) | |
| tree | 37f0e2b6572a806bdeac6351016043fd8f2c2ddf | |
| parent | 0edd4f9499523d9f6c48607fe8dc70c84c5a404a (diff) | |
| download | rust-905b63d64f8f91016a7fb0e40f0c0ae4f5e8cc51.tar.gz rust-905b63d64f8f91016a7fb0e40f0c0ae4f5e8cc51.zip | |
Fetch diagnostic item later.
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 310e542e5a5..9bdb8ae6a5f 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -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()) |
