aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorJade <[email protected]>2021-04-08 12:37:34 +0100
committerJade <[email protected]>2021-04-08 22:43:19 +0100
commit4529f1be81b3b1424447908f2446776f44748fcd (patch)
tree156a62b6a97c93c987ddd6609ab4ec5a690c0c1b /crates/hir_def
parent855a739ebf736db8a9a66e0e073c34631275fb22 (diff)
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.
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
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!(
435 for AttrDefId 435 for AttrDefId
436); 436);
437 437
438impl From<AssocContainerId> for AttrDefId {
439 fn from(acid: AssocContainerId) -> Self {
440 match acid {
441 AssocContainerId::ModuleId(mid) => AttrDefId::ModuleId(mid),
442 AssocContainerId::ImplId(iid) => AttrDefId::ImplId(iid),
443 AssocContainerId::TraitId(tid) => AttrDefId::TraitId(tid),
444 }
445 }
446}
447
438#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 448#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
439pub enum VariantId { 449pub enum VariantId {
440 EnumVariantId(EnumVariantId), 450 EnumVariantId(EnumVariantId),