From 3ea4d4385053bb4b0da87de57aac3563e085a0e3 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 20 Dec 2020 21:53:55 +0100 Subject: Properly parse legacy trait objects with leading ForType --- .../inline/ok/0154_no_dyn_trait_leading_for.rast | 43 ++++++++++++++++++++++ .../inline/ok/0154_no_dyn_trait_leading_for.rs | 1 + 2 files changed, 44 insertions(+) create mode 100644 crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast create mode 100644 crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs (limited to 'crates/syntax/test_data/parser/inline') diff --git a/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast b/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast new file mode 100644 index 000000000..edfcb288c --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast @@ -0,0 +1,43 @@ +SOURCE_FILE@0..34 + TYPE_ALIAS@0..33 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + DYN_TRAIT_TYPE@9..32 + TYPE_BOUND_LIST@9..32 + TYPE_BOUND@9..25 + FOR_TYPE@9..25 + FOR_KW@9..12 "for" + GENERIC_PARAM_LIST@12..16 + L_ANGLE@12..13 "<" + LIFETIME_PARAM@13..15 + LIFETIME@13..15 + LIFETIME_IDENT@13..15 "\'a" + R_ANGLE@15..16 ">" + WHITESPACE@16..17 " " + PATH_TYPE@17..25 + PATH@17..25 + PATH_SEGMENT@17..25 + NAME_REF@17..21 + IDENT@17..21 "Test" + GENERIC_ARG_LIST@21..25 + L_ANGLE@21..22 "<" + LIFETIME_ARG@22..24 + LIFETIME@22..24 + LIFETIME_IDENT@22..24 "\'a" + R_ANGLE@24..25 ">" + WHITESPACE@25..26 " " + PLUS@26..27 "+" + WHITESPACE@27..28 " " + TYPE_BOUND@28..32 + PATH_TYPE@28..32 + PATH@28..32 + PATH_SEGMENT@28..32 + NAME_REF@28..32 + IDENT@28..32 "Send" + SEMICOLON@32..33 ";" + WHITESPACE@33..34 "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs b/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs new file mode 100644 index 000000000..47a71fd19 --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs @@ -0,0 +1 @@ +type A = for<'a> Test<'a> + Send; -- cgit v1.2.3