Fix ICE when opaque captures a duplicated/invalid lifetime

This commit is contained in:
Michael Goulet 2025-01-01 16:55:10 +00:00
parent 7f75bfa1ad
commit d3c6067275
8 changed files with 53 additions and 27 deletions

View file

@ -2007,7 +2007,10 @@ fn check_variances_for_type_defn<'tcx>(
}
match hir_param.name {
hir::ParamName::Error => {}
hir::ParamName::Error(_) => {
// Don't report a bivariance error for a lifetime that isn't
// even valid to name.
}
_ => {
let has_explicit_bounds = explicitly_bounded_params.contains(&parameter);
report_bivariance(tcx, hir_param, has_explicit_bounds, item);