rustc_pattern_analysis

Trait Idx

pub trait Idx:
    Copy
    + 'static
    + Eq
    + PartialEq
    + Debug
    + Hash {
    // Required methods
    fn new(idx: usize) -> Self;
    fn index(self) -> usize;

    // Provided methods
    fn increment_by(&mut self, amount: usize) { ... }
    fn plus(self, amount: usize) -> Self { ... }
}
Expand description

Represents some newtyped usize wrapper.

Purpose: avoid mixing indexes for different bitvector domains.

Required Methods§

fn new(idx: usize) -> Self

fn index(self) -> usize

Provided Methods§

fn increment_by(&mut self, amount: usize)

fn plus(self, amount: usize) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl Idx for u32

§

fn new(idx: usize) -> u32

§

fn index(self) -> usize

§

impl Idx for usize

§

fn new(idx: usize) -> usize

§

fn index(self) -> usize

Source§

impl Idx for NodeId

Source§

fn new(value: usize) -> NodeId

Source§

fn index(self) -> usize

Source§

impl Idx for ErrCode

Source§

fn new(value: usize) -> ErrCode

Source§

fn index(self) -> usize

Source§

impl Idx for FirstStatementIndex

Source§

impl Idx for BlockMarkerId

Source§

impl Idx for ConditionId

Source§

impl Idx for CounterId

Source§

fn new(value: usize) -> CounterId

Source§

fn index(self) -> usize

Source§

impl Idx for ExpressionId

Source§

impl Idx for CoroutineSavedLocal

Source§

impl Idx for BasicBlock

Source§

impl Idx for Local

Source§

fn new(value: usize) -> Local

Source§

fn index(self) -> usize

Source§

impl Idx for Promoted

Source§

fn new(value: usize) -> Promoted

Source§

fn index(self) -> usize

Source§

impl Idx for SourceScope

Source§

impl Idx for ArmId

Source§

fn new(value: usize) -> ArmId

Source§

fn index(self) -> usize

Source§

impl Idx for BlockId

Source§

fn new(value: usize) -> BlockId

Source§

fn index(self) -> usize

Source§

impl Idx for ExprId

Source§

fn new(value: usize) -> ExprId

Source§

fn index(self) -> usize

Source§

impl Idx for ParamId

Source§

fn new(value: usize) -> ParamId

Source§

fn index(self) -> usize

Source§

impl Idx for StmtId

Source§

fn new(value: usize) -> StmtId

Source§

fn index(self) -> usize

Source§

impl Idx for UserTypeAnnotationIndex

Source§

impl Idx for CrateNum

Source§

fn new(value: usize) -> CrateNum

Source§

fn index(self) -> usize

Source§

impl Idx for DefIndex

Source§

fn new(value: usize) -> DefIndex

Source§

fn index(self) -> usize

Source§

impl Idx for LocalDefId

Source§

impl Idx for ExpnIndex

Source§

fn new(value: usize) -> ExpnIndex

Source§

fn index(self) -> usize

Source§

impl Idx for LocalExpnId

Source§

impl Idx for AttrId

Source§

fn new(value: usize) -> AttrId

Source§

fn index(self) -> usize

§

impl Idx for BoundVar

§

fn new(value: usize) -> BoundVar

§

fn index(self) -> usize

§

impl Idx for ConstVid

§

fn new(value: usize) -> ConstVid

§

fn index(self) -> usize

§

impl Idx for DebruijnIndex

§

fn new(value: usize) -> DebruijnIndex

§

fn index(self) -> usize

§

impl Idx for DepNodeIndex

§

fn new(value: usize) -> DepNodeIndex

§

fn index(self) -> usize

§

impl Idx for FieldIdx

§

fn new(value: usize) -> FieldIdx

§

fn index(self) -> usize

§

impl Idx for FloatVid

§

fn new(value: usize) -> FloatVid

§

fn index(self) -> usize

§

impl Idx for IntVid

§

fn new(value: usize) -> IntVid

§

fn index(self) -> usize

§

impl Idx for ItemLocalId

§

fn new(value: usize) -> ItemLocalId

§

fn index(self) -> usize

§

impl Idx for OwnerId

§

fn new(idx: usize) -> OwnerId

§

fn index(self) -> usize

§

impl Idx for RegionVid

§

fn new(value: usize) -> RegionVid

§

fn index(self) -> usize

§

impl Idx for SerializedDepNodeIndex

§

fn new(value: usize) -> SerializedDepNodeIndex

§

fn index(self) -> usize

§

impl Idx for StackDepth

§

fn new(value: usize) -> StackDepth

§

fn index(self) -> usize

§

impl Idx for TyVid

§

fn new(value: usize) -> TyVid

§

fn index(self) -> usize

§

impl Idx for UniverseIndex

§

fn new(value: usize) -> UniverseIndex

§

fn index(self) -> usize

§

impl Idx for VariantIdx

§

fn new(value: usize) -> VariantIdx

§

fn index(self) -> usize

Implementors§