about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2023-04-06 21:40:43 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2023-04-06 23:01:38 -0400
commite4edf00f12527bdaa20879f0ace46a1d7f46eb6d (patch)
tree2ca8e47c445d2d99cff18eb9a69c1174c66e6b0d
parent167b70692ba2a97521237d36b487fbfccd3fb72b (diff)
downloadrust-e4edf00f12527bdaa20879f0ace46a1d7f46eb6d.tar.gz
rust-e4edf00f12527bdaa20879f0ace46a1d7f46eb6d.zip
Don't use BrAnon index in diagnostics
-rw-r--r--compiler/rustc_infer/src/errors/note_and_explain.rs5
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/mod.rs4
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/errors/note_and_explain.rs b/compiler/rustc_infer/src/errors/note_and_explain.rs
index ef543b1fb93..9058ed7e45b 100644
--- a/compiler/rustc_infer/src/errors/note_and_explain.rs
+++ b/compiler/rustc_infer/src/errors/note_and_explain.rs
@@ -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)),
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
index 40d57606817..ad495ee9fc5 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
@@ -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)