rustdoc::clean::utils

Function can_elide_generic_arg

Source
fn can_elide_generic_arg<'tcx>(
    actual: Binder<'tcx, GenericArg<'tcx>>,
    default: Binder<'tcx, GenericArg<'tcx>>,
) -> bool
Expand description

Check if the generic argument actual coincides with the default and can therefore be elided.

This uses a very conservative approach for performance and correctness reasons, meaning for several classes of terms it claims that they cannot be elided even if they theoretically could. This is absolutely fine since it mostly concerns edge cases.