contains_ty_adt_constructor_opaque in clippy_utils::ty - Rust
Description: Walks into `ty` and returns `true` if any inner type is an instance of the given type, or adt constructor of the same type.

Skip to main content

## contains_ty_adt_constructor_opaque

# Function contains_ty_adt_constructor_opaque

Source

    pub fn contains_ty_adt_constructor_opaque<'tcx>(
        cx: &LateContext<'tcx>,
        ty: Ty<'tcx>,
        needle: Ty<'tcx>,
    ) -> bool

Expand description

Walks into `ty` and returns `true` if any inner type is an instance of the given type, or adt constructor of the same type.

This method also recurses into opaque type predicates, so call it with `impl Trait<U>` and `U` will also return `true`.