Content-Length: 24530 | pFad | https://doc.rust-lang.org/std/string/../str/pattern/../../string/../../../error_codes/./E0370.html

E0370 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0370

The maximum value of an enum was reached, so it cannot be automatically set in the next enum value.

Erroneous code example:

#![allow(unused)]
fn main() {
#[repr(i64)]
enum Foo {
    X = 0x7fffffffffffffff,
    Y, // error: enum discriminant overflowed on value after
       //        9223372036854775807: i64; set explicitly via
       //        Y = -9223372036854775808 if that is desired outcome
}
}

To fix this, please set manually the next enum value or put the enum variant with the maximum value at the end of the enum. Examples:

#![allow(unused)]
fn main() {
#[repr(i64)]
enum Foo {
    X = 0x7fffffffffffffff,
    Y = 0, // ok!
}
}

Or:

#![allow(unused)]
fn main() {
#[repr(i64)]
enum Foo {
    Y = 0, // ok!
    X = 0x7fffffffffffffff,
}
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../str/pattern/../../string/../../../error_codes/./E0370.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy