From 1c97c1ac11459d45f7bfc57dc72428d2b294520c Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sun, 17 Feb 2019 19:08:34 +0200 Subject: Enable parsing of attributes inside a match block We allow invalid inner attributes to be parsed, e.g. inner attributes that are not directly after the opening brace of the match block. Instead we run validation on `MatchArmList` to allow better reporting of errors. --- .../data/parser/err/0032_match_arms_inner_attrs.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs (limited to 'crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs') diff --git a/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs b/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs new file mode 100644 index 000000000..06aa47770 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs @@ -0,0 +1,20 @@ +fn foo() { + match () { + _ => (), + #![doc("Not allowed here")] + _ => (), + } + + match () { + _ => (), + _ => (), + #![doc("Nor here")] + } + + match () { + #[cfg(test)] + #![doc("Nor here")] + _ => (), + _ => (), + } +} -- cgit v1.2.3