rustc_middle::ty::diagnostics

Function suggest_constraining_type_param

source
pub fn suggest_constraining_type_param(
    tcx: TyCtxt<'_>,
    generics: &Generics<'_>,
    err: &mut Diag<'_>,
    param_name: &str,
    constraint: &str,
    def_id: Option<DefId>,
    span_to_replace: Option<Span>,
) -> bool
Expand description

Suggest restricting a type param with a new bound.

If span_to_replace is provided, then that span will be replaced with the constraint. If one wasn’t provided, then the full bound will be suggested.