aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/types.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-24 19:49:53 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-24 19:49:53 +0000
commit449eea11617e79c90b5d8de0959ef2bbe2a5d730 (patch)
tree62248d1b075f477f12f67b0044f12223ac0326bc /crates/ra_parser/src/grammar/types.rs
parent18a8f48039fbfcbbf58e1dadcc95465fe9503691 (diff)
parent95505e80fc0f8470fb8eb01b6d46a44d9a3e10dc (diff)
Merge #1039
1039: Support references in higher-ranked trait bounds r=matklad a=vipentti Fixes #1020 Co-authored-by: Ville Penttinen <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/grammar/types.rs')
-rw-r--r--crates/ra_parser/src/grammar/types.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs
index adc189a29..fdd4f2c52 100644
--- a/crates/ra_parser/src/grammar/types.rs
+++ b/crates/ra_parser/src/grammar/types.rs
@@ -202,12 +202,15 @@ pub(super) fn for_binder(p: &mut Parser) {
202 202
203// test for_type 203// test for_type
204// type A = for<'a> fn() -> (); 204// type A = for<'a> fn() -> ();
205// fn foo<T>(_t: &T) where for<'a> &'a T: Iterator {}
206// fn bar<T>(_t: &T) where for<'a> &'a mut T: Iterator {}
205pub(super) fn for_type(p: &mut Parser) { 207pub(super) fn for_type(p: &mut Parser) {
206 assert!(p.at(FOR_KW)); 208 assert!(p.at(FOR_KW));
207 let m = p.start(); 209 let m = p.start();
208 for_binder(p); 210 for_binder(p);
209 match p.current() { 211 match p.current() {
210 FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), 212 FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p),
213 AMP => reference_type(p),
211 _ if paths::is_path_start(p) => path_type_(p, false), 214 _ if paths::is_path_start(p) => path_type_(p, false),
212 _ => p.error("expected a path"), 215 _ => p.error("expected a path"),
213 } 216 }