Parse correctly fn f<T>() where T: Fn() -> u8 + Send {}

We used to parse it as T: Fn() -> (u8 + Send), which is different from
the rustc behavior of T: (Fn() -> u8) + Send
This commit is contained in:
Luca Barbieri 2020-04-03 21:12:10 +02:00 committed by Aleksey Kladov
parent 689661c959
commit 74e3b48806
3 changed files with 63 additions and 1 deletions

View file

@ -245,7 +245,7 @@ fn opt_fn_ret_type(p: &mut Parser) -> bool {
if p.at(T![->]) {
let m = p.start();
p.bump(T![->]);
types::type_(p);
types::type_no_bounds(p);
m.complete(p, RET_TYPE);
true
} else {