diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-29 01:28:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 01:28:27 +0100 |
commit | 9d199486dacb982535ed77a2e8aef830ac44a5b5 (patch) | |
tree | a86dcceb9494cd243a2e1f6c10edd1c7be1f8fb5 /crates/syntax/test_data/parser/inline | |
parent | 49b219b1035e20143818d409404b5e6f19a7ad1d (diff) | |
parent | caee3a2eebd514f5a2f5e68a9fcd4428fa34d41c (diff) |
Merge #8684
8684: Correctly parse negated literals as const args r=jonas-schievink a=jonas-schievink
Previously we didn't accept `S::<-0>;`
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Diffstat (limited to 'crates/syntax/test_data/parser/inline')
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast | 30 | ||||
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast new file mode 100644 index 000000000..b20e523dc --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rast | |||
@@ -0,0 +1,30 @@ | |||
1 | SOURCE_FILE@0..19 | ||
2 | FN@0..18 | ||
3 | FN_KW@0..2 "fn" | ||
4 | WHITESPACE@2..3 " " | ||
5 | NAME@3..4 | ||
6 | IDENT@3..4 "f" | ||
7 | PARAM_LIST@4..6 | ||
8 | L_PAREN@4..5 "(" | ||
9 | R_PAREN@5..6 ")" | ||
10 | WHITESPACE@6..7 " " | ||
11 | BLOCK_EXPR@7..18 | ||
12 | L_CURLY@7..8 "{" | ||
13 | WHITESPACE@8..9 " " | ||
14 | PATH_EXPR@9..16 | ||
15 | PATH@9..16 | ||
16 | PATH_SEGMENT@9..16 | ||
17 | NAME_REF@9..10 | ||
18 | IDENT@9..10 "S" | ||
19 | GENERIC_ARG_LIST@10..16 | ||
20 | COLON2@10..12 "::" | ||
21 | L_ANGLE@12..13 "<" | ||
22 | CONST_ARG@13..15 | ||
23 | PREFIX_EXPR@13..15 | ||
24 | MINUS@13..14 "-" | ||
25 | LITERAL@14..15 | ||
26 | INT_NUMBER@14..15 "1" | ||
27 | R_ANGLE@15..16 ">" | ||
28 | WHITESPACE@16..17 " " | ||
29 | R_CURLY@17..18 "}" | ||
30 | WHITESPACE@18..19 "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs new file mode 100644 index 000000000..8a81d05cd --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0164_const_generic_negated_literal.rs | |||
@@ -0,0 +1 @@ | |||
fn f() { S::<-1> } | |||