From 46265a0809d85eeb5e9b3316996a789e094e05b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hlusi=C4=8Dka?= Date: Tue, 9 Aug 2016 22:42:35 +0200 Subject: [PATCH] E0263 updated to new format. rust-lang/rust#35518 --- src/librustc/middle/resolve_lifetime.rs | 12 ++++++++---- src/test/compile-fail/E0263.rs | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 7f6614a959c89..aa74fb2e02fa0 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -718,10 +718,14 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { let lifetime_j = &lifetimes[j]; if lifetime_i.lifetime.name == lifetime_j.lifetime.name { - span_err!(self.sess, lifetime_j.lifetime.span, E0263, - "lifetime name `{}` declared twice in \ - the same scope", - lifetime_j.lifetime.name); + struct_span_err!(self.sess, lifetime_j.lifetime.span, E0263, + "lifetime name `{}` declared twice in the same scope", + lifetime_j.lifetime.name) + .span_label(lifetime_j.lifetime.span, + &format!("declared twice")) + .span_label(lifetime_i.lifetime.span, + &format!("previous declaration here")) + .emit(); } } diff --git a/src/test/compile-fail/E0263.rs b/src/test/compile-fail/E0263.rs index 09f654c368c62..11a8ff443a845 100644 --- a/src/test/compile-fail/E0263.rs +++ b/src/test/compile-fail/E0263.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) { } //~ ERROR E0263 +fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) { + //~^ ERROR E0263 + //~| NOTE declared twice + //~| NOTE previous declaration here +} fn main() {}