syn icon indicating copy to clipboard operation
syn copied to clipboard

Incorrect disambiguation of `|| a .. b .. c`

Open dtolnay opened this issue 3 years ago • 1 comments

let _ = || 0 .. 0 .. None.unwrap();

Rustc parses this as (|| (0..0))..None.unwrap() which is of type Range<impl Fn() -> Range<int>>.

Syn parses || ((0..0)..None.unwrap()) which is Range<Range<int>>.

dtolnay avatar Dec 30 '21 20:12 dtolnay

To be fair, it's impossible for me to tell whether this isn't a rustc bug.

dtolnay avatar Jan 23 '23 05:01 dtolnay