Unnamed repository; edit this file 'description' to name the repository.
Merge #11211
11211: fix: Fix parsing of `#[derive]` paths r=jonas-schievink a=jonas-schievink Currently this code produces an empty derive path for every `,`, which makes the IDE layer resolve derive paths to the wrong derive macro in the list. Skip `,`s to fix that. (nameres just ignored them, so it didn't cause problems there) bors r+ Co-authored-by: Jonas Schievink <[email protected]>
bors[bot] 2022-01-06
parent 4a1e4ee · parent b1d6aea · commit 7111c27
-rw-r--r--crates/hir_def/src/attr.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index ca87b501aa..b0be892c7d 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -737,6 +737,7 @@ impl Attr {
matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Punct(Punct { char: ',', .. })))
})
.into_iter()
+ .filter(|(comma, _)| !*comma)
.map(|(_, tts)| {
let segments = tts.filter_map(|tt| match tt {
tt::TokenTree::Leaf(tt::Leaf::Ident(id)) => Some(id.as_name()),