fix: fix expansion order for fn-like macros and attributes in token descending

This commit is contained in:
Lukas Wirth 2021-09-14 01:20:43 +02:00
parent 6eecd84771
commit bb946f78f6
3 changed files with 76 additions and 54 deletions

View file

@ -220,6 +220,29 @@ mod tests {
assert!(navs.is_empty(), "didn't expect this to resolve anywhere: {:?}", navs)
}
#[test]
fn goto_def_in_mac_call_in_attr_invoc() {
check(
r#"
//- proc_macros: identity
pub struct Struct {
// ^^^^^^
field: i32,
}
macro_rules! identity {
($($tt:tt)*) => {$($tt)*};
}
#[proc_macros::identity]
fn function() {
identity!(Struct$0 { field: 0 });
}
"#,
)
}
#[test]
fn goto_def_for_extern_crate() {
check(