aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar/items/traits.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-31 16:24:30 +0100
committerAleksey Kladov <[email protected]>2018-07-31 16:24:30 +0100
commitcd814fdf8113bc801b735ed462ba142e98f1f81b (patch)
tree07d131346f583ccdbc24fb5ebe81fa69d21290e5 /src/parser/grammar/items/traits.rs
parent892acc5b36552995515f91d2bc14ae82f81d7b8d (diff)
trait bounds
Diffstat (limited to 'src/parser/grammar/items/traits.rs')
-rw-r--r--src/parser/grammar/items/traits.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser/grammar/items/traits.rs b/src/parser/grammar/items/traits.rs
index 7d657ced0..60158fe41 100644
--- a/src/parser/grammar/items/traits.rs
+++ b/src/parser/grammar/items/traits.rs
@@ -1,9 +1,16 @@
1use super::*; 1use super::*;
2 2
3// test trait_item
4// trait T<U>: Hash + Clone where U: Copy {}
3pub(super) fn trait_item(p: &mut Parser) { 5pub(super) fn trait_item(p: &mut Parser) {
4 assert!(p.at(TRAIT_KW)); 6 assert!(p.at(TRAIT_KW));
5 p.bump(); 7 p.bump();
6 name(p); 8 name(p);
9 type_params::list(p);
10 if p.at(COLON) {
11 type_params::bounds(p);
12 }
13 type_params::where_clause(p);
7 p.expect(L_CURLY); 14 p.expect(L_CURLY);
8 p.expect(R_CURLY); 15 p.expect(R_CURLY);
9} 16}