Skip to content

Commit e4edf00

Browse files
committed
Don't use BrAnon index in diagnostics
1 parent 167b706 commit e4edf00

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

compiler/rustc_infer/src/errors/note_and_explain.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ impl<'a> DescriptionCtx<'a> {
9090
};
9191
me.span = Some(sp);
9292
}
93-
ty::BrAnon(idx, span) => {
94-
me.kind = "anon_num_here";
95-
me.num_arg = idx+1;
93+
ty::BrAnon(_, span) => {
94+
me.kind = "defined_here";
9695
me.span = match span {
9796
Some(_) => span,
9897
None => Some(tcx.def_span(scope)),

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ fn msg_span_from_early_bound_and_free_regions<'tcx>(
226226
};
227227
(text, sp)
228228
}
229-
ty::BrAnon(idx, span) => (
230-
format!("the anonymous lifetime #{} defined here", idx + 1),
229+
ty::BrAnon(_, span) => (
230+
"the anonymous lifetime as defined here".to_string(),
231231
match span {
232232
Some(span) => span,
233233
None => tcx.def_span(scope)

0 commit comments

Comments
 (0)