mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
Reverse fixups
This commit is contained in:
parent
79ebf618ec
commit
c3601e9860
@ -76,7 +76,6 @@ fn foo() {
|
||||
#[test]
|
||||
fn attribute_macro_syntax_completion_2() {
|
||||
// common case of dot completion while typing
|
||||
// right now not working
|
||||
check(
|
||||
r#"
|
||||
//- proc_macros: identity_when_valid
|
||||
@ -88,7 +87,7 @@ fn foo() { bar.; blub }
|
||||
fn foo() { bar.; blub }
|
||||
|
||||
fn foo() {
|
||||
bar.;
|
||||
bar. ;
|
||||
blub
|
||||
}"##]],
|
||||
);
|
||||
|
@ -430,7 +430,7 @@ fn macro_expand(db: &dyn AstDatabase, id: MacroCallId) -> ExpandResult<Option<Ar
|
||||
// be reported at the definition site (when we construct a def map).
|
||||
Err(err) => return ExpandResult::str_err(format!("invalid macro definition: {}", err)),
|
||||
};
|
||||
let ExpandResult { value: tt, err } = expander.expand(db, id, ¯o_arg.0);
|
||||
let ExpandResult { value: mut tt, err } = expander.expand(db, id, ¯o_arg.0);
|
||||
// Set a hard limit for the expanded tt
|
||||
let count = tt.count();
|
||||
// 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
|
||||
));
|
||||
}
|
||||
|
||||
fixup::reverse_fixups(&mut tt);
|
||||
|
||||
ExpandResult { value: Some(Arc::new(tt)), err }
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Conversions between [`SyntaxNode`] and [`tt::TokenTree`].
|
||||
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use stdx::{non_empty_vec::NonEmptyVec, always};
|
||||
use stdx::{always, non_empty_vec::NonEmptyVec};
|
||||
use syntax::{
|
||||
ast::{self, make::tokens::doc_comment},
|
||||
AstToken, Parse, PreorderWithTokens, SmolStr, SyntaxElement, SyntaxKind,
|
||||
|
Loading…
Reference in New Issue
Block a user