let Some((bounds, _)) = tybounds.get_mut(ty) else { return true };
let bound_params = bound_params
.into_iter()
- .map(|param| clean::GenericParamDef {
- name: param.0,
- kind: clean::GenericParamDefKind::Lifetime { outlives: Vec::new() },
- })
+ .map(|param| clean::GenericParamDef::lifetime(param.0))
.collect();
merge_bounds(cx, bounds, bound_params, trait_did, name, rhs)
});
let last = trait_ref.trait_.segments.last_mut().expect("segments were empty");
trait_ref.generic_params.append(&mut bound_params);
- // Since the parameters (probably) originate from `tcx.collect_*_late_bound_regions` which
- // returns a hash set, sort them alphabetically to guarantee a stable and deterministic
- // output (and to fully deduplicate them).
+ // Sort parameters (likely) originating from a hashset alphabetically to
+ // produce predictable output (and to allow for full deduplication).
trait_ref.generic_params.sort_unstable_by(|p, q| p.name.as_str().cmp(q.name.as_str()));
trait_ref.generic_params.dedup_by_key(|p| p.name);