[−][src]Struct rustc_mir_build::thir::cx::Cx
Fields
tcx: TyCtxt<'tcx>infcx: &'a InferCtxt<'a, 'tcx>root_lint_level: HirIdparam_env: ParamEnv<'tcx>identity_substs: &'tcx InternalSubsts<'tcx>Identity InternalSubsts for use with const-evaluation.
region_scope_tree: &'tcx ScopeTreetypeck_results: &'a TypeckResults<'tcx>constness: ConstnessThis is Constness::Const if we are compiling a static,
const, or the body of a const fn.
body_owner: DefIdThe DefId of the owner of this body.
body_owner_kind: BodyOwnerKindWhat kind of body is being compiled.
check_overflow: boolWhether this constant/function needs overflow checks.
Implementations
impl<'a, 'tcx> Cx<'a, 'tcx>[src]
pub(crate) fn new(
infcx: &'a InferCtxt<'a, 'tcx>,
def: WithOptConstParam<LocalDefId>,
src_id: HirId
) -> Cx<'a, 'tcx>[src]
infcx: &'a InferCtxt<'a, 'tcx>,
def: WithOptConstParam<LocalDefId>,
src_id: HirId
) -> Cx<'a, 'tcx>
impl<'a, 'tcx> Cx<'a, 'tcx>[src]
pub(crate) fn mirror<M: Mirror<'tcx>>(&mut self, ast: M) -> M::Output[src]
Normalizes ast into the appropriate "mirror" type.
pub(crate) fn usize_ty(&mut self) -> Ty<'tcx>[src]
pub(crate) fn usize_literal(&mut self, value: u64) -> &'tcx Const<'tcx>[src]
pub(crate) fn bool_ty(&mut self) -> Ty<'tcx>[src]
pub(crate) fn unit_ty(&mut self) -> Ty<'tcx>[src]
pub(crate) fn true_literal(&mut self) -> &'tcx Const<'tcx>[src]
pub(crate) fn false_literal(&mut self) -> &'tcx Const<'tcx>[src]
pub(crate) fn const_eval_literal(
&mut self,
lit: &'tcx LitKind,
ty: Ty<'tcx>,
sp: Span,
neg: bool
) -> &'tcx Const<'tcx>[src]
&mut self,
lit: &'tcx LitKind,
ty: Ty<'tcx>,
sp: Span,
neg: bool
) -> &'tcx Const<'tcx>
pub(crate) fn pattern_from_hir(&mut self, p: &Pat<'_>) -> Pat<'tcx>[src]
pub(crate) fn trait_method(
&mut self,
trait_def_id: DefId,
method_name: Symbol,
self_ty: Ty<'tcx>,
params: &[GenericArg<'tcx>]
) -> &'tcx Const<'tcx>[src]
&mut self,
trait_def_id: DefId,
method_name: Symbol,
self_ty: Ty<'tcx>,
params: &[GenericArg<'tcx>]
) -> &'tcx Const<'tcx>
pub(crate) fn all_fields(
&mut self,
adt_def: &AdtDef,
variant_index: VariantIdx
) -> Vec<Field>[src]
&mut self,
adt_def: &AdtDef,
variant_index: VariantIdx
) -> Vec<Field>
pub(crate) fn needs_drop(&mut self, ty: Ty<'tcx>) -> bool[src]
pub(crate) fn infcx(&self) -> &'a InferCtxt<'a, 'tcx>[src]
pub(crate) fn tcx(&self) -> TyCtxt<'tcx>[src]
pub(crate) fn typeck_results(&self) -> &'a TypeckResults<'tcx>[src]
pub(crate) fn check_overflow(&self) -> bool[src]
pub(crate) fn type_is_copy_modulo_regions(
&self,
ty: Ty<'tcx>,
span: Span
) -> bool[src]
&self,
ty: Ty<'tcx>,
span: Span
) -> bool
Trait Implementations
impl<'a, 'tcx> Clone for Cx<'a, 'tcx>[src]
impl<'tcx, '_> UserAnnotatedTyHelpers<'tcx> for Cx<'_, 'tcx>[src]
pub(crate) fn tcx(&self) -> TyCtxt<'tcx>[src]
pub(crate) fn typeck_results(&self) -> &TypeckResults<'tcx>[src]
pub(crate) fn user_substs_applied_to_ty_of_hir_id(
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>[src]
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for Cx<'a, 'tcx>
impl<'a, 'tcx> !Send for Cx<'a, 'tcx>
impl<'a, 'tcx> !Sync for Cx<'a, 'tcx>
impl<'a, 'tcx> Unpin for Cx<'a, 'tcx> where
'tcx: 'a,
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for Cx<'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<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
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>,