aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-30 20:27:23 +0100
committerAleksey Kladov <[email protected]>2018-07-30 20:27:23 +0100
commit27a40e0a8844310960f12294fe7cd1f5b6d25fcb (patch)
treed526a1a0b8084ef0c67179c28fc4bbc273f481e1 /src/parser/grammar
parent72d49c5a107efdd6a2900183939935f0f6d13d5b (diff)
type param defaults
Diffstat (limited to 'src/parser/grammar')
-rw-r--r--src/parser/grammar/type_params.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parser/grammar/type_params.rs b/src/parser/grammar/type_params.rs
index 9ea08a55c..ba0d4bfe8 100644
--- a/src/parser/grammar/type_params.rs
+++ b/src/parser/grammar/type_params.rs
@@ -40,6 +40,8 @@ pub(super) fn list(p: &mut Parser) {
40 let m = p.start(); 40 let m = p.start();
41 p.bump(); 41 p.bump();
42 if p.eat(COLON) { 42 if p.eat(COLON) {
43 // test type_param_bounds
44 // struct S<T: 'a + ?Sized + (Copy)>;
43 loop { 45 loop {
44 let has_paren = p.eat(L_PAREN); 46 let has_paren = p.eat(L_PAREN);
45 p.eat(QUESTION); 47 p.eat(QUESTION);
@@ -61,7 +63,10 @@ pub(super) fn list(p: &mut Parser) {
61 } 63 }
62 } 64 }
63 } 65 }
66 // test type_param_default
67 // struct S<T = i32>;
64 if p.at(EQ) { 68 if p.at(EQ) {
69 p.bump();
65 types::type_(p) 70 types::type_(p)
66 } 71 }
67 m.complete(p, TYPE_PARAM); 72 m.complete(p, TYPE_PARAM);