Rollup merge of #35557 - Limeth:master, r=jonathandturner

E0263 updated to new format.

Fixes #35518. Part of #35233.
r? @jonathandturner
This commit is contained in:
Jonathan Turner 2016-08-11 06:34:01 -07:00 committed by GitHub
commit aaed538b24
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() {}