diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs b/src/test/ui/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs new file mode 100644 index 000000000..f30d7e2ed --- /dev/null +++ b/src/test/ui/issues/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs @@ -0,0 +1,16 @@ +// run-pass +#![allow(unused_variables)] +#![deny(non_shorthand_field_patterns)] + +pub struct Value<A> { pub value: A } + +#[macro_export] +macro_rules! pat { + ($a:pat) => { + Value { value: $a } + }; +} + +fn main() { + let pat!(value) = Value { value: () }; +} |