about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-06-24 18:47:25 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-06-24 18:47:25 +0200
commita081507451c675562a30bf4b6f6b01c2229b8601 (patch)
tree1cfd54267aba687fff7bb270949f26eefefa646b
parentb1d53a42dc2517ec873c97752bc23c9ae88c9390 (diff)
downloadrust-a081507451c675562a30bf4b6f6b01c2229b8601.tar.gz
rust-a081507451c675562a30bf4b6f6b01c2229b8601.zip
beta fallout.
-rw-r--r--compiler/rustc_resolve/src/late/lifetimes.rs13
-rw-r--r--src/test/ui/impl-trait/universal_wrong_hrtb.stderr6
2 files changed, 7 insertions, 12 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs
index f45b345487f..ff75e4eae35 100644
--- a/compiler/rustc_resolve/src/late/lifetimes.rs
+++ b/compiler/rustc_resolve/src/late/lifetimes.rs
@@ -2360,12 +2360,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
                 Scope::Binder {
                     where_bound_origin: Some(hir::PredicateOrigin::ImplTrait), ..
                 } => {
-                    let mut err = self.tcx.sess.struct_span_err(
-                        lifetime_ref.span,
-                        "`impl Trait` can only mention lifetimes bound at the fn or impl level",
-                    );
-                    err.span_note(self.tcx.def_span(region_def_id), "lifetime declared here");
-                    err.emit();
+                    self.tcx
+                        .sess
+                        .struct_span_err(
+                            lifetime_ref.span,
+                            "`impl Trait` can only mention lifetimes bound at the fn or impl level",
+                        )
+                        .emit();
                     return;
                 }
                 Scope::Root => break,
diff --git a/src/test/ui/impl-trait/universal_wrong_hrtb.stderr b/src/test/ui/impl-trait/universal_wrong_hrtb.stderr
index 37eb8dfa1a1..3b3a7addb4a 100644
--- a/src/test/ui/impl-trait/universal_wrong_hrtb.stderr
+++ b/src/test/ui/impl-trait/universal_wrong_hrtb.stderr
@@ -3,12 +3,6 @@ error: `impl Trait` can only mention lifetimes bound at the fn or impl level
    |
 LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
    |                                                                         ^^
-   |
-note: lifetime declared here
-  --> $DIR/universal_wrong_hrtb.rs:5:39
-   |
-LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
-   |                                       ^^
 
 error: aborting due to previous error