diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-11 18:47:45 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-11 18:47:45 +0100 |
commit | 6afd9b2b8dcfaa9338303f29d8fc6c90dbcdd6e7 (patch) | |
tree | b1534743851c3805c64fe764f9d0bf8f7ab9f7ef /crates/hir_def/src/lib.rs | |
parent | 9fa9d166d8141bb9ca4fcf0544c49b903fb85e09 (diff) | |
parent | 8ea9d939d2c44feb71e2d1c8ec390a9471b75e57 (diff) |
Merge #8796
8796: internal: rewrite `#[derive]` removal to be based on AST (take 2) r=jonas-schievink a=jonas-schievink
Second attempt of https://github.com/rust-analyzer/rust-analyzer/pull/8443, this uses syntactical attribute offsets in `hir_expand`, and changes `attr.rs` to make those easy to derive.
This will make it easy to add similar attribute removal for attribute macros, unblocking them.
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/lib.rs')
-rw-r--r-- | crates/hir_def/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index e96ca953f..a82ea5957 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs | |||
@@ -62,14 +62,14 @@ use hir_expand::{ | |||
62 | ast_id_map::FileAstId, | 62 | ast_id_map::FileAstId, |
63 | eager::{expand_eager_macro, ErrorEmitted, ErrorSink}, | 63 | eager::{expand_eager_macro, ErrorEmitted, ErrorSink}, |
64 | hygiene::Hygiene, | 64 | hygiene::Hygiene, |
65 | AstId, AttrId, FragmentKind, HirFileId, InFile, MacroCallId, MacroCallKind, MacroDefId, | 65 | AstId, FragmentKind, HirFileId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, |
66 | MacroDefKind, | ||
67 | }; | 66 | }; |
68 | use la_arena::Idx; | 67 | use la_arena::Idx; |
69 | use nameres::DefMap; | 68 | use nameres::DefMap; |
70 | use path::ModPath; | 69 | use path::ModPath; |
71 | use syntax::ast; | 70 | use syntax::ast; |
72 | 71 | ||
72 | use crate::attr::AttrId; | ||
73 | use crate::builtin_type::BuiltinType; | 73 | use crate::builtin_type::BuiltinType; |
74 | use item_tree::{ | 74 | use item_tree::{ |
75 | Const, Enum, Function, Impl, ItemTreeId, ItemTreeNode, ModItem, Static, Struct, Trait, | 75 | Const, Enum, Function, Impl, ItemTreeId, ItemTreeNode, ModItem, Static, Struct, Trait, |
@@ -753,7 +753,7 @@ fn derive_macro_as_call_id( | |||
753 | MacroCallKind::Derive { | 753 | MacroCallKind::Derive { |
754 | ast_id: item_attr.ast_id, | 754 | ast_id: item_attr.ast_id, |
755 | derive_name: last_segment.to_string(), | 755 | derive_name: last_segment.to_string(), |
756 | derive_attr, | 756 | derive_attr_index: derive_attr.ast_index, |
757 | }, | 757 | }, |
758 | ) | 758 | ) |
759 | .into(); | 759 | .into(); |