diff options
author | Ville Penttinen <[email protected]> | 2019-02-17 17:08:34 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-02-17 17:26:57 +0000 |
commit | 1c97c1ac11459d45f7bfc57dc72428d2b294520c (patch) | |
tree | 70638cabf61f96a7511f974cc66dae40175bfb22 /crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs | |
parent | 982f72c022b45629e6adbaef22884359d3495ecf (diff) |
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.
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs')
-rw-r--r-- | crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | #![doc("Not allowed here")] | ||
5 | _ => (), | ||
6 | } | ||
7 | |||
8 | match () { | ||
9 | _ => (), | ||
10 | _ => (), | ||
11 | #![doc("Nor here")] | ||
12 | } | ||
13 | |||
14 | match () { | ||
15 | #[cfg(test)] | ||
16 | #![doc("Nor here")] | ||
17 | _ => (), | ||
18 | _ => (), | ||
19 | } | ||
20 | } | ||