Closed dtolnay closed 4 years ago
It's possible this was hitting a compiler bug before, but for whatever reason the literals macro doesn't seem to work as written. See https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d0c8d46f71a62369c5e2709181e7f046 for analogous code extracted out to the playground.
literals
This PR changes the matcher for $value from $($value:expr)+ to $($($value:literal)..=+)|+ which does work -- see https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b6fd7a18f6ed0a5c94f892ab100a5d11.
$($value:expr)+
$($($value:literal)..=+)|+
Thanks for the PR.
Interesting this code always compiles for me (and few other users) as well as in GH action.
It's possible this was hitting a compiler bug before, but for whatever reason the
literals
macro doesn't seem to work as written. See https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d0c8d46f71a62369c5e2709181e7f046 for analogous code extracted out to the playground.This PR changes the matcher for $value from
$($value:expr)+
to$($($value:literal)..=+)|+
which does work -- see https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b6fd7a18f6ed0a5c94f892ab100a5d11.