pub(crate) fn suggest_to_remove_or_use_generic(
tcx: TyCtxt<'_>,
diag: &mut Diag<'_>,
impl_def_id: LocalDefId,
param: &GenericParamDef,
is_lifetime: bool,
)Expand description
Adds a suggestion to a diagnostic to either remove an unused generic parameter, or use it.
ยงExamples
impl<T> Struct { ... }whereTis unused -> suggests removingTor using it.impl<T> Struct { // T used in here }whereTis used in the body but not in the self type -> suggests addingTto the self type and struct definition.impl<T> Struct { ... }where the struct has a generic parameter with a default -> suggests addingTto the self type.