From 76ddface089886c88b8b29e3893119f38ef26aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 23 Jun 2020 09:41:43 +0300 Subject: Fix panic in split and merge import assists --- .../test_data/parser/err/0004_use_path_bad_segment.rast | 5 ++--- .../test_data/parser/inline/err/0015_empty_segment.rast | 15 +++++++++++++++ .../test_data/parser/inline/err/0015_empty_segment.rs | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rast create mode 100644 crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rs (limited to 'crates/ra_syntax/test_data/parser') diff --git a/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast b/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast index 8c6b89dc2..b3bcf472a 100644 --- a/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast +++ b/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast @@ -9,8 +9,7 @@ SOURCE_FILE@0..12 NAME_REF@4..7 IDENT@4..7 "foo" COLON2@7..9 "::" - PATH_SEGMENT@9..11 - ERROR@9..11 - INT_NUMBER@9..11 "92" + ERROR@9..11 + INT_NUMBER@9..11 "92" SEMICOLON@11..12 ";" error 9..9: expected identifier diff --git a/crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rast b/crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rast new file mode 100644 index 000000000..da8505607 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rast @@ -0,0 +1,15 @@ +SOURCE_FILE@0..13 + USE_ITEM@0..12 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..12 + PATH@4..12 + PATH@4..9 + PATH_SEGMENT@4..9 + CRATE_KW@4..9 "crate" + COLON2@9..11 "::" + ERROR@11..12 + SEMICOLON@11..12 ";" + WHITESPACE@12..13 "\n" +error 11..11: expected identifier +error 12..12: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rs b/crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rs new file mode 100644 index 000000000..7510664e1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rs @@ -0,0 +1 @@ +use crate::; -- cgit v1.2.3