We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02a18a6 commit 49e9974Copy full SHA for 49e9974
1 file changed
src/test/run-pass/stmt_expr_attr_macro_parse.rs
@@ -17,6 +17,16 @@ macro_rules! m {
17
}
18
19
20
+macro_rules! n {
21
+ (#[$attr:meta] $e:expr) => {
22
+ "expr excludes attr"
23
+ };
24
+ ($e:expr) => {
25
+ "expr includes attr"
26
+ }
27
+}
28
+
29
fn main() {
- assert_eq!(m!(#[attr] 1 + 1), "expr includes attr");
30
+ assert_eq!(m!(#[attr] 1), "expr includes attr");
31
+ assert_eq!(n!(#[attr] 1), "expr excludes attr");
32
0 commit comments