Merge #7060
7060: Fix mbe fail to pass expr with attr r=edwin0cheng a=edwin0cheng bors r+ Fixes #5896 Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
commit
77ad203a71
@ -677,7 +677,7 @@ fn macro_expansion_overflow() {
|
|||||||
r#"
|
r#"
|
||||||
macro_rules! a {
|
macro_rules! a {
|
||||||
($e:expr; $($t:tt)*) => {
|
($e:expr; $($t:tt)*) => {
|
||||||
b!($($t)*);
|
b!(static = (); $($t)*);
|
||||||
};
|
};
|
||||||
() => {};
|
() => {};
|
||||||
}
|
}
|
||||||
@ -689,7 +689,7 @@ macro_rules! b {
|
|||||||
() => {};
|
() => {};
|
||||||
}
|
}
|
||||||
|
|
||||||
b! { static = #[] (); }
|
b! { static = #[] ();}
|
||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
crate
|
crate
|
||||||
|
@ -760,6 +760,18 @@ fn test_last_expr() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_expr_with_attr() {
|
||||||
|
parse_macro(
|
||||||
|
r#"
|
||||||
|
macro_rules! m {
|
||||||
|
($a:expr) => {0}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.assert_expand_items("m!(#[allow(a)]())", "0");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ty() {
|
fn test_ty() {
|
||||||
parse_macro(
|
parse_macro(
|
||||||
|
@ -59,7 +59,7 @@ pub(crate) mod fragments {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) fn expr(p: &mut Parser) {
|
pub(crate) fn expr(p: &mut Parser) {
|
||||||
let _ = expressions::expr(p);
|
let _ = expressions::expr_with_attrs(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn stmt(p: &mut Parser) {
|
pub(crate) fn stmt(p: &mut Parser) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user