Struct rustc_typeck::check::cast::CastCheck [−][src]
pub struct CastCheck<'tcx> {
expr: &'tcx Expr,
expr_ty: Ty<'tcx>,
cast_ty: Ty<'tcx>,
cast_span: Span,
span: Span,
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Reifies a cast check to be checked once we have full type information for a function context.
Fields
expr: &'tcx Expr
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
expr_ty: Ty<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
cast_ty: Ty<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
cast_span: Span
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
span: Span
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<'a, 'gcx, 'tcx> CastCheck<'tcx>[src]
impl<'a, 'gcx, 'tcx> CastCheck<'tcx>pub fn new(
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
expr: &'tcx Expr,
expr_ty: Ty<'tcx>,
cast_ty: Ty<'tcx>,
cast_span: Span,
span: Span
) -> Result<CastCheck<'tcx>, ErrorReported>[src]
pub fn new(
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
expr: &'tcx Expr,
expr_ty: Ty<'tcx>,
cast_ty: Ty<'tcx>,
cast_span: Span,
span: Span
) -> Result<CastCheck<'tcx>, ErrorReported>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn report_cast_error(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>, e: CastError)[src]
fn report_cast_error(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>, e: CastError)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn report_cast_to_unsized_type(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>)[src]
fn report_cast_to_unsized_type(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn trivial_cast_lint(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>)[src]
fn trivial_cast_lint(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn check(self, fcx: &FnCtxt<'a, 'gcx, 'tcx>)[src]
pub fn check(self, fcx: &FnCtxt<'a, 'gcx, 'tcx>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn do_check(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>) -> Result<CastKind, CastError>[src]
fn do_check(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>) -> Result<CastKind, CastError>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Check a cast, and report an error if one exists. In some cases, this can return Ok and create type errors in the fcx rather than returning directly. coercion-cast is handled in check instead of here.
fn check_ptr_ptr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_expr: TypeAndMut<'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>[src]
fn check_ptr_ptr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_expr: TypeAndMut<'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn check_fptr_ptr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>[src]
fn check_fptr_ptr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn check_ptr_addr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_expr: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>[src]
fn check_ptr_addr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_expr: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn check_ref_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_expr: TypeAndMut<'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>[src]
fn check_ref_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_expr: TypeAndMut<'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn check_addr_ptr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>[src]
fn check_addr_ptr_cast(
&self,
fcx: &FnCtxt<'a, 'gcx, 'tcx>,
m_cast: TypeAndMut<'tcx>
) -> Result<CastKind, CastError>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn try_coercion_cast(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>) -> bool[src]
fn try_coercion_cast(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?