Propagate TraitImplHeader to hir

This commit is contained in:
Cameron Steffen
2025-07-24 09:32:58 -05:00
parent 5bc23ce255
commit bf266dc834
59 changed files with 316 additions and 299 deletions

View File

@@ -582,8 +582,8 @@ impl Diagnostics {
for (_hir_id, parent) in cx.tcx.hir_parent_iter(current_id) {
debug!(?parent);
if let hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(impl_), .. }) = parent
&& let hir::Impl { of_trait: Some(of_trait), .. } = impl_
&& let Some(def_id) = of_trait.trait_def_id()
&& let Some(of_trait) = impl_.of_trait
&& let Some(def_id) = of_trait.trait_ref.trait_def_id()
&& let Some(name) = cx.tcx.get_diagnostic_name(def_id)
&& matches!(name, sym::Diagnostic | sym::Subdiagnostic | sym::LintDiagnostic)
{