E0263 updated to new format. rust-lang/rust#35518

This commit is contained in:
Jakub Hlusička 2016-08-09 22:42:35 +02:00
parent f0139140f6
commit 46265a0809
2 changed files with 13 additions and 5 deletions

View file

@ -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();
}
}

View file

@ -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() {}