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

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§

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 FieldIdx

Source§

fn new(value: usize) -> FieldIdx

Source§

fn index(self) -> usize

Source§

impl Idx for VariantIdx

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 ConstVid

Source§

fn new(value: usize) -> ConstVid

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§