[−][src]Struct rustc_mir::transform::function_item_references::FunctionItemRefChecker

pub(in transform::function_item_references) struct FunctionItemRefChecker<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    body: &'a Body<'tcx>,
}

Fields

tcx: TyCtxt<'tcx>body: &'a Body<'tcx>

Implementations

impl<'a, 'tcx> FunctionItemRefChecker<'a, 'tcx>[src]

pub(in transform::function_item_references) fn check_bound_args(
    &self,
    def_id: DefId,
    substs_ref: SubstsRef<'tcx>,
    args: &Vec<Operand<'tcx>>,
    source_info: SourceInfo
)
[src]

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.

pub(in transform::function_item_references) fn is_pointer_trait(
    &self,
    bound: &PredicateAtom<'tcx>
) -> Option<Ty<'tcx>>
[src]

If the given predicate is the trait fmt::Pointer, returns the bound parameter type.

pub(in transform::function_item_references) fn is_fn_ref(
    ty: Ty<'tcx>
) -> Option<(DefId, SubstsRef<'tcx>)>
[src]

If a type is a reference or raw pointer to the anonymous type of a function definition, returns that function's DefId and SubstsRef.

pub(in transform::function_item_references) fn nth_arg_span(
    &self,
    args: &Vec<Operand<'tcx>>,
    n: usize
) -> Span
[src]

pub(in transform::function_item_references) fn emit_lint(
    &self,
    fn_id: DefId,
    fn_substs: SubstsRef<'tcx>,
    source_info: SourceInfo,
    span: Span
)
[src]

Trait Implementations

impl<'a, 'tcx> Visitor<'tcx> for FunctionItemRefChecker<'a, 'tcx>[src]

pub fn visit_terminator(
    &mut self,
    terminator: &Terminator<'tcx>,
    location: Location
)
[src]

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.

pub fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location)[src]

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.

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

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]