Skip to content

Commit 7111c27

Browse files
bors[bot]Jonas Schievink
andauthored
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]>
2 parents 4a1e4ee + b1d6aea commit 7111c27

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/hir_def/src/attr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ impl Attr {
737737
matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Punct(Punct { char: ',', .. })))
738738
})
739739
.into_iter()
740+
.filter(|(comma, _)| !*comma)
740741
.map(|(_, tts)| {
741742
let segments = tts.filter_map(|tt| match tt {
742743
tt::TokenTree::Leaf(tt::Leaf::Ident(id)) => Some(id.as_name()),

0 commit comments

Comments
 (0)