diff options
author | Edwin Cheng <[email protected]> | 2020-12-28 11:53:00 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-12-28 11:53:00 +0000 |
commit | 710407b11dce7274ccf16b072fb500b9e5d4fb15 (patch) | |
tree | 13d1b64bdd37db998cc8a24434146efdfb02415a /crates/mbe | |
parent | 1d530756ed7ba175ec32ff71247072798dc9a748 (diff) |
Fix mbe fail to pass expr with attr
Diffstat (limited to 'crates/mbe')
-rw-r--r-- | crates/mbe/src/tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs index 6cd0ed205..0147506c7 100644 --- a/crates/mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs | |||
@@ -761,6 +761,18 @@ fn test_last_expr() { | |||
761 | } | 761 | } |
762 | 762 | ||
763 | #[test] | 763 | #[test] |
764 | fn test_expr_with_attr() { | ||
765 | parse_macro( | ||
766 | r#" | ||
767 | macro_rules! m { | ||
768 | ($a:expr) => {0} | ||
769 | } | ||
770 | "#, | ||
771 | ) | ||
772 | .assert_expand_items("m!(#[allow(a)]())", "0"); | ||
773 | } | ||
774 | |||
775 | #[test] | ||
764 | fn test_ty() { | 776 | fn test_ty() { |
765 | parse_macro( | 777 | parse_macro( |
766 | r#" | 778 | r#" |