mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
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:
commit
aaed538b24
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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() {}
|
||||
|
Loading…
Reference in New Issue
Block a user