mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Allow attributes on top level expression
A top level expression is either - a expression statement or - the last expression in a block
This commit is contained in:
parent
1cd18f9237
commit
ffed132e52
8 changed files with 231 additions and 35 deletions
|
@ -105,7 +105,9 @@ pub(super) fn process(sink: &mut dyn TreeSink, mut events: Vec<Event>) {
|
|||
// append `A`'s forward_parent `B`
|
||||
fp = match mem::replace(&mut events[idx], Event::tombstone()) {
|
||||
Event::Start { kind, forward_parent } => {
|
||||
forward_parents.push(kind);
|
||||
if kind != TOMBSTONE {
|
||||
forward_parents.push(kind);
|
||||
}
|
||||
forward_parent
|
||||
}
|
||||
_ => unreachable!(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue