dtolnay/iota

Support underscore constants

Open

#3 opened on Dec 26, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Rust (1 fork)github user discovery
help wanted

Repository metrics

Stars
 (18 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

As introduced in rust 1.37: https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html#using-unnamed-const-items-for-macros

Iota currently rejects code containing underscore names.

iota! {
    const A: u8 = 1 << iota;
        | _
        | C
}
error: no rules expected the token `|`
 --> src/main.rs:5:9
  |
5 |         | _
  |         ^ no rules expected this token in macro call

Contributor guide