[−][src]Struct rustc_trait_selection::traits::const_evaluatable::AbstractConstBuilder
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
impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx>[src]
pub(in traits::const_evaluatable) fn error(
&mut self,
span: Option<Span>,
msg: &str
) -> Result<!, ErrorReported>[src]
&mut self,
span: Option<Span>,
msg: &str
) -> Result<!, ErrorReported>
pub(in traits::const_evaluatable) fn new(
tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>
) -> Result<Option<AbstractConstBuilder<'a, 'tcx>>, ErrorReported>[src]
tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>
) -> Result<Option<AbstractConstBuilder<'a, 'tcx>>, ErrorReported>
pub(in traits::const_evaluatable) fn add_node(
&mut self,
node: Node<'tcx>,
span: Span
) -> NodeId[src]
&mut self,
node: Node<'tcx>,
span: Span
) -> NodeId
pub(in traits::const_evaluatable) fn place_to_local(
&mut self,
span: Span,
p: &Place<'tcx>
) -> Result<Local, ErrorReported>[src]
&mut self,
span: Span,
p: &Place<'tcx>
) -> Result<Local, ErrorReported>
pub(in traits::const_evaluatable) fn operand_to_node(
&mut self,
span: Span,
op: &Operand<'tcx>
) -> Result<NodeId, ErrorReported>[src]
&mut self,
span: Span,
op: &Operand<'tcx>
) -> Result<NodeId, ErrorReported>
pub(in traits::const_evaluatable) fn check_binop(
op: BinOp
) -> bool[src]
op: BinOp
) -> bool
We do not allow all binary operations in abstract consts, so filter disallowed ones.
pub(in traits::const_evaluatable) fn check_unop(
op: UnOp
) -> bool[src]
op: UnOp
) -> bool
While we currently allow all unary operations, we still want to explicitly guard against future changes here.
pub(in traits::const_evaluatable) fn build_statement(
&mut self,
stmt: &Statement<'tcx>
) -> Result<(), ErrorReported>[src]
&mut self,
stmt: &Statement<'tcx>
) -> Result<(), ErrorReported>
pub(in traits::const_evaluatable) fn build_terminator(
&mut self,
terminator: &Terminator<'tcx>
) -> Result<Option<BasicBlock>, ErrorReported>[src]
&mut self,
terminator: &Terminator<'tcx>
) -> Result<Option<BasicBlock>, ErrorReported>
Possible return values:
None: unsupported terminator, stop buildingSome(None): supported terminator, finish buildingSome(Some(block)): support terminator, buildblocknext
pub(in traits::const_evaluatable) fn build(
self
) -> Result<&'tcx [Node<'tcx>], ErrorReported>[src]
self
) -> Result<&'tcx [Node<'tcx>], ErrorReported>
Builds the abstract const by walking the mir from start to finish and bailing out when encountering an unsupported operation.
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for AbstractConstBuilder<'a, 'tcx>
impl<'a, 'tcx> !Send for AbstractConstBuilder<'a, 'tcx>
impl<'a, 'tcx> !Sync for AbstractConstBuilder<'a, 'tcx>
impl<'a, 'tcx> Unpin for AbstractConstBuilder<'a, 'tcx> where
'tcx: 'a,
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for AbstractConstBuilder<'a, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.