rustc_pattern_analysis

Trait Idx

source
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§

source

fn new(idx: usize) -> Self

source

fn index(self) -> usize

Provided Methods§

source

fn increment_by(&mut self, amount: usize)

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Idx for u32

source§

fn new(idx: usize) -> u32

source§

fn index(self) -> usize

source§

impl Idx for usize

source§

fn new(idx: usize) -> usize

source§

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 ItemLocalId

source§

impl Idx for OwnerId

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 DepNodeIndex

source§

impl Idx for SerializedDepNodeIndex

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

source§

impl Idx for FieldIdx

source§

fn new(value: usize) -> FieldIdx

source§

fn index(self) -> usize

source§

impl Idx for VariantIdx

source§

impl Idx for ConstVid

source§

fn new(value: usize) -> ConstVid

source§

fn index(self) -> usize

source§

impl Idx for EffectVid

source§

fn new(value: usize) -> EffectVid

source§

fn index(self) -> usize

source§

impl Idx for RegionVid

source§

fn new(value: usize) -> RegionVid

source§

fn index(self) -> usize

source§

impl Idx for StackDepth

source§

impl Idx for BoundVar

source§

fn new(value: usize) -> BoundVar

source§

fn index(self) -> usize

source§

impl Idx for DebruijnIndex

source§

impl Idx for UniverseIndex

source§

impl Idx for FloatVid

source§

fn new(value: usize) -> FloatVid

source§

fn index(self) -> usize

source§

impl Idx for IntVid

source§

fn new(value: usize) -> IntVid

source§

fn index(self) -> usize

source§

impl Idx for TyVid

source§

fn new(value: usize) -> TyVid

source§

fn index(self) -> usize

Implementors§