clippy_utils::ty

Function implements_trait_with_env

Source
pub fn implements_trait_with_env<'tcx>(
    tcx: TyCtxt<'tcx>,
    typing_env: TypingEnv<'tcx>,
    ty: Ty<'tcx>,
    trait_id: DefId,
    callee_id: Option<DefId>,
    args: &[GenericArg<'tcx>],
) -> bool
Expand description

Same as implements_trait but allows using a ParamEnv different from the lint context.

The callee_id argument is used to determine whether this is a function call in a const fn environment, used for checking const traits.