From 4529f1be81b3b1424447908f2446776f44748fcd Mon Sep 17 00:00:00 2001 From: Jade Date: Thu, 8 Apr 2021 04:37:34 -0700 Subject: decl_check: consider outer scopes' allows Fix #8417. Also makes it less noisy about no_mangle annotated stuff the user can do nothing about. Note: this still is broken with bitfield! macros. A repro in an ignore test is included here. I believe this bug is elsewhere, and I don't think I can work around it here. --- crates/hir_def/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/hir_def/src/lib.rs') diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index e2af0e514..eefc75706 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs @@ -435,6 +435,16 @@ impl_from!( for AttrDefId ); +impl From for AttrDefId { + fn from(acid: AssocContainerId) -> Self { + match acid { + AssocContainerId::ModuleId(mid) => AttrDefId::ModuleId(mid), + AssocContainerId::ImplId(iid) => AttrDefId::ImplId(iid), + AssocContainerId::TraitId(tid) => AttrDefId::TraitId(tid), + } + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum VariantId { EnumVariantId(EnumVariantId), -- cgit v1.2.3