Struct rustc_mir_transform::function_item_references::FunctionItemRefChecker [−][src]
Fields
tcx: TyCtxt<'tcx>
body: &'a Body<'tcx>
Implementations
fn check_bound_args(
&self,
def_id: DefId,
substs_ref: SubstsRef<'tcx>,
args: &[Operand<'tcx>],
source_info: SourceInfo
)
fn check_bound_args(
&self,
def_id: DefId,
substs_ref: SubstsRef<'tcx>,
args: &[Operand<'tcx>],
source_info: SourceInfo
)
Emits a lint for function reference arguments bound by fmt::Pointer
in calls to the
function defined by def_id
with the substitutions substs_ref
.
If the given predicate is the trait fmt::Pointer
, returns the bound parameter type.
If a type is a reference or raw pointer to the anonymous type of a function definition,
returns that function’s DefId
and SubstsRef
.
Trait Implementations
Emits a lint for function reference arguments bound by fmt::Pointer
or passed to
transmute
. This only handles arguments in calls outside macro expansions to avoid double
counting function references formatted as pointers by macros.
Emits a lint for function references formatted with fmt::Pointer::fmt
by macros. These
cases are handled as operands instead of call terminators to avoid any dependence on
unstable, internal formatting details like whether fmt
is called directly or not.
fn visit_ascribe_user_ty(
&mut self,
place: &Place<'tcx>,
variance: &Variance,
user_ty: &UserTypeProjection,
location: Location
)
fn visit_projection(
&mut self,
place_ref: PlaceRef<'tcx>,
context: PlaceContext,
location: Location
)
fn visit_projection_elem(
&mut self,
local: Local,
proj_base: &[ProjectionElem<Local, &'tcx TyS<'tcx>>],
elem: ProjectionElem<Local, &'tcx TyS<'tcx>>,
context: PlaceContext,
location: Location
)
fn super_projection(
&mut self,
place_ref: PlaceRef<'tcx>,
context: PlaceContext,
location: Location
)
fn super_projection_elem(
&mut self,
_local: Local,
_proj_base: &[ProjectionElem<Local, &'tcx TyS<'tcx>>],
elem: ProjectionElem<Local, &'tcx TyS<'tcx>>,
_context: PlaceContext,
location: Location
)
fn visit_user_type_annotation(
&mut self,
index: UserTypeAnnotationIndex,
ty: &CanonicalUserTypeAnnotation<'tcx>
)
fn super_ascribe_user_ty(
&mut self,
place: &Place<'tcx>,
_variance: &Variance,
user_ty: &UserTypeProjection,
location: Location
)
fn super_user_type_annotation(
&mut self,
_index: UserTypeAnnotationIndex,
ty: &CanonicalUserTypeAnnotation<'tcx>
)
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for FunctionItemRefChecker<'a, 'tcx>
impl<'a, 'tcx> !Send for FunctionItemRefChecker<'a, 'tcx>
impl<'a, 'tcx> !Sync for FunctionItemRefChecker<'a, 'tcx>
impl<'a, 'tcx> Unpin for FunctionItemRefChecker<'a, 'tcx> where
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for FunctionItemRefChecker<'a, 'tcx>
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may even differ between compilations. 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: 16 bytes