Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c3601e9

Browse files
committed
Reverse fixups
1 parent 79ebf61 commit c3601e9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

crates/hir_def/src/macro_expansion_tests/proc_macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ fn foo() {
7676
#[test]
7777
fn attribute_macro_syntax_completion_2() {
7878
// common case of dot completion while typing
79-
// right now not working
8079
check(
8180
r#"
8281
//- proc_macros: identity_when_valid
@@ -88,7 +87,7 @@ fn foo() { bar.; blub }
8887
fn foo() { bar.; blub }
8988
9089
fn foo() {
91-
bar.;
90+
bar. ;
9291
blub
9392
}"##]],
9493
);

crates/hir_expand/src/db.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ fn macro_expand(db: &dyn AstDatabase, id: MacroCallId) -> ExpandResult<Option<Ar
430430
// be reported at the definition site (when we construct a def map).
431431
Err(err) => return ExpandResult::str_err(format!("invalid macro definition: {}", err)),
432432
};
433-
let ExpandResult { value: tt, err } = expander.expand(db, id, &macro_arg.0);
433+
let ExpandResult { value: mut tt, err } = expander.expand(db, id, &macro_arg.0);
434434
// Set a hard limit for the expanded tt
435435
let count = tt.count();
436436
// XXX: Make ExpandResult a real error and use .map_err instead?
@@ -442,6 +442,8 @@ fn macro_expand(db: &dyn AstDatabase, id: MacroCallId) -> ExpandResult<Option<Ar
442442
));
443443
}
444444

445+
fixup::reverse_fixups(&mut tt);
446+
445447
ExpandResult { value: Some(Arc::new(tt)), err }
446448
}
447449

crates/mbe/src/syntax_bridge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Conversions between [`SyntaxNode`] and [`tt::TokenTree`].
22
33
use rustc_hash::{FxHashMap, FxHashSet};
4-
use stdx::{non_empty_vec::NonEmptyVec, always};
4+
use stdx::{always, non_empty_vec::NonEmptyVec};
55
use syntax::{
66
ast::{self, make::tokens::doc_comment},
77
AstToken, Parse, PreorderWithTokens, SmolStr, SyntaxElement, SyntaxKind,

0 commit comments

Comments
 (0)