Struct rustc_trait_selection::traits::const_evaluatable::AbstractConstBuilder[−][src]

struct AbstractConstBuilder<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    body: &'a Body<'tcx>,
    nodes: IndexVec<NodeId, WorkNode<'tcx>>,
    locals: IndexVec<Local, NodeId>,
    checked_op_locals: BitSet<Local>,
}

Fields

tcx: TyCtxt<'tcx>body: &'a Body<'tcx>nodes: IndexVec<NodeId, WorkNode<'tcx>>

The current WIP node tree.

We require all nodes to be used in the final abstract const, so we store this here. Note that we also consider nodes as used if they are mentioned in an assert, so some used nodes are never actually reachable by walking the AbstractConst.

locals: IndexVec<Local, NodeId>checked_op_locals: BitSet<Local>

We only allow field accesses if they access the result of a checked operation.

Implementations

We do not allow all binary operations in abstract consts, so filter disallowed ones.

While we currently allow all unary operations, we still want to explicitly guard against future changes here.

Possible return values:

  • None: unsupported terminator, stop building
  • Some(None): supported terminator, finish building
  • Some(Some(block)): support terminator, build block next

Builds the abstract const by walking the mir from start to finish and bailing out when encountering an unsupported operation.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 96 bytes