Merge pull request #21527 from ChayimFriedman2/builtin-macro-name
fix: Fix macro matching of `meta` then `=>` or `==`
This commit is contained in:
commit
4430fd8ef4
2 changed files with 21 additions and 1 deletions
|
|
@ -237,3 +237,23 @@ fn test() {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn meta_fat_arrow() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m {
|
||||
( $m:meta => ) => {};
|
||||
}
|
||||
|
||||
m! { foo => }
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m {
|
||||
( $m:meta => ) => {};
|
||||
}
|
||||
|
||||
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ pub(super) fn meta(p: &mut Parser<'_>) {
|
|||
paths::attr_path(p);
|
||||
|
||||
match p.current() {
|
||||
T![=] => {
|
||||
T![=] if !p.at(T![=>]) && !p.at(T![==]) => {
|
||||
p.bump(T![=]);
|
||||
if expressions::expr(p).is_none() {
|
||||
p.error("expected expression");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue