From 95505e80fc0f8470fb8eb01b6d46a44d9a3e10dc Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sun, 24 Mar 2019 20:51:55 +0200 Subject: Support references in higher-ranked trait bounds Fixes #1020 --- crates/ra_parser/src/grammar/types.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/ra_parser') 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) { // test for_type // type A = for<'a> fn() -> (); +// fn foo(_t: &T) where for<'a> &'a T: Iterator {} +// fn bar(_t: &T) where for<'a> &'a mut T: Iterator {} pub(super) fn for_type(p: &mut Parser) { assert!(p.at(FOR_KW)); let m = p.start(); for_binder(p); match p.current() { FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), + AMP => reference_type(p), _ if paths::is_path_start(p) => path_type_(p, false), _ => p.error("expected a path"), } -- cgit v1.2.3