aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/params.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-23 23:19:38 +0100
committerAleksey Kladov <[email protected]>2018-08-23 23:19:38 +0100
commitdc40f1298a8d4dcb7a26d5af38c4fb7ef3d6c5df (patch)
tree618354b471933003577ff2a5616c27bd272f62f3 /crates/libsyntax2/src/grammar/params.rs
parentcf7d4a2a243cac1975b9b28d47ed91a6bd01b34f (diff)
better self-types
Diffstat (limited to 'crates/libsyntax2/src/grammar/params.rs')
-rw-r--r--crates/libsyntax2/src/grammar/params.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/libsyntax2/src/grammar/params.rs b/crates/libsyntax2/src/grammar/params.rs
index 7e58e8713..47567ec8a 100644
--- a/crates/libsyntax2/src/grammar/params.rs
+++ b/crates/libsyntax2/src/grammar/params.rs
@@ -92,16 +92,18 @@ fn value_parameter(p: &mut Parser, flavor: Flavor) {
92// fn b(&self,) {} 92// fn b(&self,) {}
93// fn c(&'a self,) {} 93// fn c(&'a self,) {}
94// fn d(&'a mut self, x: i32) {} 94// fn d(&'a mut self, x: i32) {}
95// fn e(mut self) {}
95// } 96// }
96fn self_param(p: &mut Parser) { 97fn self_param(p: &mut Parser) {
97 let m; 98 let m;
98 if p.at(SELF_KW) { 99 if p.at(SELF_KW) || p.at(MUT_KW) && p.nth(1) == SELF_KW {
99 m = p.start(); 100 m = p.start();
100 p.bump(); 101 p.eat(MUT_KW);
102 p.eat(SELF_KW);
101 // test arb_self_types 103 // test arb_self_types
102 // impl S { 104 // impl S {
103 // fn a(self: &Self) {} 105 // fn a(self: &Self) {}
104 // fn b(self: Box<Self>) {} 106 // fn b(mut self: Box<Self>) {}
105 // } 107 // }
106 if p.at(COLON) { 108 if p.at(COLON) {
107 types::ascription(p); 109 types::ascription(p);