From 83433cd1f0ce2ebe1818caa6793f61372e4fa5a6 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Fri, 23 Aug 2019 16:19:23 -0700 Subject: Centralize `box` pattern tests in `patterns.rs` --- crates/ra_parser/src/grammar/expressions/atom.rs | 2 -- crates/ra_parser/src/grammar/patterns.rs | 5 ----- crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rs | 6 ++++++ 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rs (limited to 'crates') diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index ab8fb9f6e..bc942ae01 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs @@ -414,8 +414,6 @@ pub(crate) fn match_arm_list(p: &mut Parser) { // X | Y if Z => (), // | X | Y if Z => (), // | X => (), -// box X => (), -// Some(box X) => (), // }; // } fn match_arm(p: &mut Parser) -> BlockLike { diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index 67f1548a7..f9e6de13c 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs @@ -269,11 +269,6 @@ fn bind_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { m.complete(p, BIND_PAT) } -// test_err ref_box_pat -// fn main() { -// let ref box i = (); -// } - // test box_pat // fn main() { // let box i = (); diff --git a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rs b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rs new file mode 100644 index 000000000..d3fa2e468 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rs @@ -0,0 +1,6 @@ +fn main() { + let ref box i = (); + let mut box i = (); + let ref mut box i = (); +} + -- cgit v1.2.3