Skip to content

uint in EnumSet instead of u64 #21977

@tilpner

Description

@tilpner

collections::enum_set::EnumSet currently uses uint (not even usize) to store the flags:

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
/// A specialized set implementation to use enum types.
pub struct EnumSet<E> {
    // We must maintain the invariant that no bits are set
    // for which no variant exists
    bits: uint
}

I believe it should be u64 (or u32), because uint/usize will lead to different behaviour and bugs for large numbers of enum variants, depending on what machine is targeted.

I would fix it myself, but I currently can't due to my 5kb/s (do not try cloning rust-lang/rust with that) connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions