From bfb90dc4f1e9d86a24207b252c5f3405037928b1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 8 Aug 2018 14:43:14 +0300 Subject: Fn-style type params --- src/grammar/paths.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/grammar/paths.rs') diff --git a/src/grammar/paths.rs b/src/grammar/paths.rs index fe69db096..6d406645f 100644 --- a/src/grammar/paths.rs +++ b/src/grammar/paths.rs @@ -71,7 +71,16 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) { fn path_generic_args(p: &mut Parser, mode: Mode) { match mode { Mode::Use => return, - Mode::Type => type_args::type_arg_list(p, false), + Mode::Type => { + // test path_fn_trait_args + // type F = Box ()>; + if p.at(L_PAREN) { + params::param_list(p); + fn_ret_type(p); + } else { + type_args::type_arg_list(p, false) + } + }, Mode::Expr => type_args::type_arg_list(p, true), } } -- cgit v1.2.3