dtolnay/iota

Support underscore constants

Ouverte

#3 ouverte le 26 déc. 2019

 (0 commentaire) (0 réaction) (0 personne assignée)Rust (1 fork)github user discovery
help wanted

Métriques du dépôt

Stars
 (18 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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

Guide contributeur