Don't use BrAnon index in diagnostics

This commit is contained in:
Jack Huey 2023-04-06 21:40:43 -04:00
parent 167b70692b
commit e4edf00f12
2 changed files with 4 additions and 5 deletions

View File

@ -90,9 +90,8 @@ impl<'a> DescriptionCtx<'a> {
};
me.span = Some(sp);
}
ty::BrAnon(idx, span) => {
me.kind = "anon_num_here";
me.num_arg = idx+1;
ty::BrAnon(_, span) => {
me.kind = "defined_here";
me.span = match span {
Some(_) => span,
None => Some(tcx.def_span(scope)),

View File

@ -226,8 +226,8 @@ fn msg_span_from_early_bound_and_free_regions<'tcx>(
};
(text, sp)
}
ty::BrAnon(idx, span) => (
format!("the anonymous lifetime #{} defined here", idx + 1),
ty::BrAnon(_, span) => (
"the anonymous lifetime as defined here".to_string(),
match span {
Some(span) => span,
None => tcx.def_span(scope)