verus-lang / verus

Verified Rust for low-level systems code
MIT License
1.25k stars 72 forks source link

Field-less enums: an issue potentially introduced with the version bump to 1.79 #1339

Open y1ca1 opened 2 weeks ago

y1ca1 commented 2 weeks ago

I'm pretty excited about this version bump as Rust 1.79 stabilized the inline const expressions. Thanks for the efforts!

However, my existing codebase breaks at a field-less enum declaration:

 enum FieldLess {
    A = 0,
    B = 1,
    C = 2,
}

Verus reports:

error: constant evaluation of enum discriminant resulted in non-integer

A repro link to the playground: https://aurorar8-eb5c.andrew.cmu.edu/?version=stable&mode=basic&edition=2021&gist=e87455afc0f418ffddbf2d5b7a2bb149

Hope this is fairly straightforward to resolve!

tjhance commented 2 weeks ago

probably the same root cause as: https://github.com/verus-lang/verus/issues/1334