diff options
author | Aleksey Kladov <[email protected]> | 2018-02-10 11:15:04 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-02-10 11:15:04 +0000 |
commit | fa2131365e8ff2a6fa4fcb47aa04e6d51a32943e (patch) | |
tree | 80bcea00fdef46350572b5ee03ffb0979d0bfed6 | |
parent | c13e6db774acca952577fa7a18599b75b407f3c2 (diff) |
G: use names in traits
-rw-r--r-- | src/parser/grammar/items/traits.rs | 2 | ||||
-rw-r--r-- | tests/data/parser/inline/0007_unsafe_trait.txt | 7 | ||||
-rw-r--r-- | tests/data/parser/inline/0009_unsafe_auto_trait.txt | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/parser/grammar/items/traits.rs b/src/parser/grammar/items/traits.rs index 3bef9639f..9961a88fe 100644 --- a/src/parser/grammar/items/traits.rs +++ b/src/parser/grammar/items/traits.rs | |||
@@ -3,7 +3,7 @@ use super::*; | |||
3 | pub(super) fn trait_item(p: &mut Parser) { | 3 | pub(super) fn trait_item(p: &mut Parser) { |
4 | assert!(p.at(TRAIT_KW)); | 4 | assert!(p.at(TRAIT_KW)); |
5 | p.bump(); | 5 | p.bump(); |
6 | p.expect(IDENT); | 6 | name(p); |
7 | p.expect(L_CURLY); | 7 | p.expect(L_CURLY); |
8 | p.expect(R_CURLY); | 8 | p.expect(R_CURLY); |
9 | } | 9 | } |
diff --git a/tests/data/parser/inline/0007_unsafe_trait.txt b/tests/data/parser/inline/0007_unsafe_trait.txt index d6f6a4cfa..9e2f82587 100644 --- a/tests/data/parser/inline/0007_unsafe_trait.txt +++ b/tests/data/parser/inline/0007_unsafe_trait.txt | |||
@@ -3,9 +3,10 @@ FILE@[0; 18) | |||
3 | UNSAFE_KW@[0; 6) | 3 | UNSAFE_KW@[0; 6) |
4 | WHITESPACE@[6; 7) | 4 | WHITESPACE@[6; 7) |
5 | TRAIT_KW@[7; 12) | 5 | TRAIT_KW@[7; 12) |
6 | WHITESPACE@[12; 13) | 6 | NAME@[12; 15) |
7 | IDENT@[13; 14) "T" | 7 | WHITESPACE@[12; 13) |
8 | WHITESPACE@[14; 15) | 8 | IDENT@[13; 14) "T" |
9 | WHITESPACE@[14; 15) | ||
9 | L_CURLY@[15; 16) | 10 | L_CURLY@[15; 16) |
10 | R_CURLY@[16; 17) | 11 | R_CURLY@[16; 17) |
11 | WHITESPACE@[17; 18) | 12 | WHITESPACE@[17; 18) |
diff --git a/tests/data/parser/inline/0009_unsafe_auto_trait.txt b/tests/data/parser/inline/0009_unsafe_auto_trait.txt index 0a9a1e117..aa1c99168 100644 --- a/tests/data/parser/inline/0009_unsafe_auto_trait.txt +++ b/tests/data/parser/inline/0009_unsafe_auto_trait.txt | |||
@@ -5,9 +5,10 @@ FILE@[0; 23) | |||
5 | AUTO_KW@[7; 11) | 5 | AUTO_KW@[7; 11) |
6 | WHITESPACE@[11; 12) | 6 | WHITESPACE@[11; 12) |
7 | TRAIT_KW@[12; 17) | 7 | TRAIT_KW@[12; 17) |
8 | WHITESPACE@[17; 18) | 8 | NAME@[17; 20) |
9 | IDENT@[18; 19) "T" | 9 | WHITESPACE@[17; 18) |
10 | WHITESPACE@[19; 20) | 10 | IDENT@[18; 19) "T" |
11 | WHITESPACE@[19; 20) | ||
11 | L_CURLY@[20; 21) | 12 | L_CURLY@[20; 21) |
12 | R_CURLY@[21; 22) | 13 | R_CURLY@[21; 22) |
13 | WHITESPACE@[22; 23) | 14 | WHITESPACE@[22; 23) |