Tweak diagnostics on shadowing lifetimes/labels
This commit is contained in:
parent
6645da366e
commit
cdcce11504
@ -1098,7 +1098,7 @@ fn signal_shadowing_problem(tcx: TyCtxt<'_>, name: Symbol, orig: Original, shado
|
||||
)
|
||||
};
|
||||
err.span_label(orig.span, "first declared here");
|
||||
err.span_label(shadower.span, format!("lifetime {} already in scope", name));
|
||||
err.span_label(shadower.span, format!("{} `{}` already in scope", orig.kind.desc(), name));
|
||||
err.emit();
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scop
|
||||
LL | impl<'a> Foo<'a> {
|
||||
| -- first declared here
|
||||
LL | fn f<'a>(x: &'a i32) {
|
||||
| ^^ lifetime 'a already in scope
|
||||
| ^^ lifetime `'a` already in scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -20,7 +20,7 @@ error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scop
|
||||
LL | trait Shadow<'a> {
|
||||
| -- first declared here
|
||||
LL | type Bar<'a>;
|
||||
| ^^ lifetime 'a already in scope
|
||||
| ^^ lifetime `'a` already in scope
|
||||
|
||||
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
|
||||
--> $DIR/shadowing.rs:14:14
|
||||
@ -28,7 +28,7 @@ error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scop
|
||||
LL | impl<'a> NoShadow<'a> for &'a u32 {
|
||||
| -- first declared here
|
||||
LL | type Bar<'a> = i32;
|
||||
| ^^ lifetime 'a already in scope
|
||||
| ^^ lifetime `'a` already in scope
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -2,7 +2,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:16:9
|
||||
|
|
||||
LL | 'x: loop { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -19,7 +19,7 @@ LL | 'x: loop {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:64:9
|
||||
@ -28,13 +28,13 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:16:9
|
||||
|
|
||||
LL | 'x: loop { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -51,7 +51,7 @@ LL | 'x: loop { $e }
|
||||
| ^^
|
||||
| |
|
||||
| first declared here
|
||||
| lifetime 'x already in scope
|
||||
| label `'x` already in scope
|
||||
...
|
||||
LL | loop_x!(break 'x);
|
||||
| ------------------ in this macro invocation
|
||||
@ -62,7 +62,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:16:9
|
||||
|
|
||||
LL | 'x: loop { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -79,7 +79,7 @@ LL | 'x: loop {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:76:9
|
||||
@ -88,7 +88,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:76:9
|
||||
@ -97,7 +97,7 @@ LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:76:9
|
||||
@ -106,13 +106,13 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:27:9
|
||||
|
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -129,7 +129,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | while_true!(break 'x);
|
||||
| ---------------------- in this macro invocation
|
||||
@ -140,7 +140,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:27:9
|
||||
|
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -157,7 +157,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | while_true!(break 'x);
|
||||
| ---------------------- in this macro invocation
|
||||
@ -168,7 +168,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:27:9
|
||||
|
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -185,7 +185,7 @@ LL | 'x: loop {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:90:9
|
||||
@ -194,7 +194,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:90:9
|
||||
@ -203,7 +203,7 @@ LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:90:9
|
||||
@ -212,7 +212,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:90:9
|
||||
@ -221,7 +221,7 @@ LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:90:9
|
||||
@ -230,13 +230,13 @@ LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:39:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -253,7 +253,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | run_once!(continue 'x);
|
||||
| ----------------------- in this macro invocation
|
||||
@ -264,7 +264,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:39:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -281,7 +281,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | run_once!(continue 'x);
|
||||
| ----------------------- in this macro invocation
|
||||
@ -292,7 +292,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:39:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -309,7 +309,7 @@ LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | run_once!(continue 'x);
|
||||
| ----------------------- in this macro invocation
|
||||
@ -320,7 +320,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels-in-let.rs:39:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
|
@ -2,7 +2,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:13:9
|
||||
|
|
||||
LL | 'x: loop { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -19,7 +19,7 @@ LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:54:5
|
||||
@ -28,13 +28,13 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:13:9
|
||||
|
|
||||
LL | 'x: loop { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -51,7 +51,7 @@ LL | 'x: loop { $e }
|
||||
| ^^
|
||||
| |
|
||||
| first declared here
|
||||
| lifetime 'x already in scope
|
||||
| label `'x` already in scope
|
||||
...
|
||||
LL | loop_x!(break 'x);
|
||||
| ------------------ in this macro invocation
|
||||
@ -62,7 +62,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:13:9
|
||||
|
|
||||
LL | 'x: loop { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -79,7 +79,7 @@ LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:63:5
|
||||
@ -88,7 +88,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:63:5
|
||||
@ -97,7 +97,7 @@ LL | 'x: loop {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:63:5
|
||||
@ -106,13 +106,13 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:38:9
|
||||
|
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -129,7 +129,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | while_x!(break 'x);
|
||||
| ------------------- in this macro invocation
|
||||
@ -140,7 +140,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:38:9
|
||||
|
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -157,7 +157,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | while_x!(break 'x);
|
||||
| ------------------- in this macro invocation
|
||||
@ -168,7 +168,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:38:9
|
||||
|
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 {
|
||||
| -- first declared here
|
||||
@ -185,7 +185,7 @@ LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:73:5
|
||||
@ -194,7 +194,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:73:5
|
||||
@ -203,7 +203,7 @@ LL | 'x: loop {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:73:5
|
||||
@ -212,7 +212,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:73:5
|
||||
@ -221,7 +221,7 @@ LL | 'x: while 1 + 1 == 2 {
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:73:5
|
||||
@ -230,13 +230,13 @@ LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
|
||||
warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:24:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
@ -253,7 +253,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | run_once!(continue 'x);
|
||||
| ----------------------- in this macro invocation
|
||||
@ -264,7 +264,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:24:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: loop {
|
||||
| -- first declared here
|
||||
@ -281,7 +281,7 @@ LL | 'x: loop { $e }
|
||||
| -- first declared here
|
||||
...
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | run_once!(continue 'x);
|
||||
| ----------------------- in this macro invocation
|
||||
@ -292,7 +292,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:24:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 {
|
||||
| -- first declared here
|
||||
@ -306,7 +306,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:24:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: while 1 + 1 == 2 { $e }
|
||||
| -- first declared here
|
||||
@ -320,7 +320,7 @@ warning: label name `'x` shadows a label name that is already in scope
|
||||
--> $DIR/hygienic-labels.rs:24:9
|
||||
|
|
||||
LL | 'x: for _ in 0..1 { $e }
|
||||
| ^^ lifetime 'x already in scope
|
||||
| ^^ label `'x` already in scope
|
||||
...
|
||||
LL | 'x: for _ in 0..1 {
|
||||
| -- first declared here
|
||||
|
@ -4,7 +4,7 @@ error[E0496]: lifetime name `'s` shadows a lifetime name that is already in scop
|
||||
LL | impl Foo<&'s u8> {
|
||||
| -- first declared here
|
||||
LL | fn bar<'s>(&self, x: &'s u8) {}
|
||||
| ^^ lifetime 's already in scope
|
||||
| ^^ lifetime `'s` already in scope
|
||||
|
||||
error[E0496]: lifetime name `'s` shadows a lifetime name that is already in scope
|
||||
--> $DIR/shadow.rs:8:19
|
||||
@ -13,7 +13,7 @@ LL | impl Foo<&'s u8> {
|
||||
| -- first declared here
|
||||
LL | fn bar<'s>(&self, x: &'s u8) {}
|
||||
LL | fn baz(x: for<'s> fn(&'s u32)) {}
|
||||
| ^^ lifetime 's already in scope
|
||||
| ^^ lifetime `'s` already in scope
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -59,7 +59,7 @@ LL | 'many_used_shadowed: for _ in 0..10 {
|
||||
| ------------------- first declared here
|
||||
LL |
|
||||
LL | 'many_used_shadowed: for _ in 0..10 {
|
||||
| ^^^^^^^^^^^^^^^^^^^ lifetime 'many_used_shadowed already in scope
|
||||
| ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
|
||||
|
||||
warning: 9 warnings emitted
|
||||
|
||||
|
@ -4,7 +4,7 @@ warning: label name `'fl` shadows a label name that is already in scope
|
||||
LL | { 'fl: for _ in 0..10 { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'fl: loop { break; } }
|
||||
| ^^^ lifetime 'fl already in scope
|
||||
| ^^^ label `'fl` already in scope
|
||||
|
||||
warning: label name `'lf` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:16:7
|
||||
@ -12,7 +12,7 @@ warning: label name `'lf` shadows a label name that is already in scope
|
||||
LL | { 'lf: loop { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'lf: for _ in 0..10 { break; } }
|
||||
| ^^^ lifetime 'lf already in scope
|
||||
| ^^^ label `'lf` already in scope
|
||||
|
||||
warning: label name `'wl` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:18:7
|
||||
@ -20,7 +20,7 @@ warning: label name `'wl` shadows a label name that is already in scope
|
||||
LL | { 'wl: while 2 > 1 { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'wl: loop { break; } }
|
||||
| ^^^ lifetime 'wl already in scope
|
||||
| ^^^ label `'wl` already in scope
|
||||
|
||||
warning: label name `'lw` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:20:7
|
||||
@ -28,7 +28,7 @@ warning: label name `'lw` shadows a label name that is already in scope
|
||||
LL | { 'lw: loop { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'lw: while 2 > 1 { break; } }
|
||||
| ^^^ lifetime 'lw already in scope
|
||||
| ^^^ label `'lw` already in scope
|
||||
|
||||
warning: label name `'fw` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:22:7
|
||||
@ -36,7 +36,7 @@ warning: label name `'fw` shadows a label name that is already in scope
|
||||
LL | { 'fw: for _ in 0..10 { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'fw: while 2 > 1 { break; } }
|
||||
| ^^^ lifetime 'fw already in scope
|
||||
| ^^^ label `'fw` already in scope
|
||||
|
||||
warning: label name `'wf` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:24:7
|
||||
@ -44,7 +44,7 @@ warning: label name `'wf` shadows a label name that is already in scope
|
||||
LL | { 'wf: while 2 > 1 { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'wf: for _ in 0..10 { break; } }
|
||||
| ^^^ lifetime 'wf already in scope
|
||||
| ^^^ label `'wf` already in scope
|
||||
|
||||
warning: label name `'tl` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:26:7
|
||||
@ -52,7 +52,7 @@ warning: label name `'tl` shadows a label name that is already in scope
|
||||
LL | { 'tl: while let Some(_) = None::<i32> { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'tl: loop { break; } }
|
||||
| ^^^ lifetime 'tl already in scope
|
||||
| ^^^ label `'tl` already in scope
|
||||
|
||||
warning: label name `'lt` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels-2.rs:28:7
|
||||
@ -60,7 +60,7 @@ warning: label name `'lt` shadows a label name that is already in scope
|
||||
LL | { 'lt: loop { break; } }
|
||||
| --- first declared here
|
||||
LL | { 'lt: while let Some(_) = None::<i32> { break; } }
|
||||
| ^^^ lifetime 'lt already in scope
|
||||
| ^^^ label `'lt` already in scope
|
||||
|
||||
warning: 8 warnings emitted
|
||||
|
||||
|
@ -4,7 +4,7 @@ warning: label name `'fl` shadows a label name that is already in scope
|
||||
LL | 'fl: for _ in 0..10 { break; }
|
||||
| --- first declared here
|
||||
LL | 'fl: loop { break; }
|
||||
| ^^^ lifetime 'fl already in scope
|
||||
| ^^^ label `'fl` already in scope
|
||||
|
||||
warning: label name `'lf` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:14:5
|
||||
@ -12,7 +12,7 @@ warning: label name `'lf` shadows a label name that is already in scope
|
||||
LL | 'lf: loop { break; }
|
||||
| --- first declared here
|
||||
LL | 'lf: for _ in 0..10 { break; }
|
||||
| ^^^ lifetime 'lf already in scope
|
||||
| ^^^ label `'lf` already in scope
|
||||
|
||||
warning: label name `'wl` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:16:5
|
||||
@ -20,7 +20,7 @@ warning: label name `'wl` shadows a label name that is already in scope
|
||||
LL | 'wl: while 2 > 1 { break; }
|
||||
| --- first declared here
|
||||
LL | 'wl: loop { break; }
|
||||
| ^^^ lifetime 'wl already in scope
|
||||
| ^^^ label `'wl` already in scope
|
||||
|
||||
warning: label name `'lw` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:18:5
|
||||
@ -28,7 +28,7 @@ warning: label name `'lw` shadows a label name that is already in scope
|
||||
LL | 'lw: loop { break; }
|
||||
| --- first declared here
|
||||
LL | 'lw: while 2 > 1 { break; }
|
||||
| ^^^ lifetime 'lw already in scope
|
||||
| ^^^ label `'lw` already in scope
|
||||
|
||||
warning: label name `'fw` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:20:5
|
||||
@ -36,7 +36,7 @@ warning: label name `'fw` shadows a label name that is already in scope
|
||||
LL | 'fw: for _ in 0..10 { break; }
|
||||
| --- first declared here
|
||||
LL | 'fw: while 2 > 1 { break; }
|
||||
| ^^^ lifetime 'fw already in scope
|
||||
| ^^^ label `'fw` already in scope
|
||||
|
||||
warning: label name `'wf` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:22:5
|
||||
@ -44,7 +44,7 @@ warning: label name `'wf` shadows a label name that is already in scope
|
||||
LL | 'wf: while 2 > 1 { break; }
|
||||
| --- first declared here
|
||||
LL | 'wf: for _ in 0..10 { break; }
|
||||
| ^^^ lifetime 'wf already in scope
|
||||
| ^^^ label `'wf` already in scope
|
||||
|
||||
warning: label name `'tl` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:24:5
|
||||
@ -52,7 +52,7 @@ warning: label name `'tl` shadows a label name that is already in scope
|
||||
LL | 'tl: while let Some(_) = None::<i32> { break; }
|
||||
| --- first declared here
|
||||
LL | 'tl: loop { break; }
|
||||
| ^^^ lifetime 'tl already in scope
|
||||
| ^^^ label `'tl` already in scope
|
||||
|
||||
warning: label name `'lt` shadows a label name that is already in scope
|
||||
--> $DIR/loops-reject-duplicate-labels.rs:26:5
|
||||
@ -60,7 +60,7 @@ warning: label name `'lt` shadows a label name that is already in scope
|
||||
LL | 'lt: loop { break; }
|
||||
| --- first declared here
|
||||
LL | 'lt: while let Some(_) = None::<i32> { break; }
|
||||
| ^^^ lifetime 'lt already in scope
|
||||
| ^^^ label `'lt` already in scope
|
||||
|
||||
warning: 8 warnings emitted
|
||||
|
||||
|
@ -4,7 +4,7 @@ warning: label name `'a` shadows a lifetime name that is already in scope
|
||||
LL | fn foo<'a>() {
|
||||
| -- first declared here
|
||||
LL | 'a: loop { break 'a; }
|
||||
| ^^ lifetime 'a already in scope
|
||||
| ^^ lifetime `'a` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:35:13
|
||||
@ -13,7 +13,7 @@ LL | impl<'bad, 'c> Struct<'bad, 'c> {
|
||||
| ---- first declared here
|
||||
LL | fn meth_bad(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:42:13
|
||||
@ -22,7 +22,7 @@ LL | impl<'b, 'bad> Struct<'b, 'bad> {
|
||||
| ---- first declared here
|
||||
LL | fn meth_bad2(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:49:13
|
||||
@ -30,7 +30,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
LL | fn meth_bad3<'bad>(x: &'bad i8) {
|
||||
| ---- first declared here
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:54:13
|
||||
@ -38,7 +38,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
LL | fn meth_bad4<'a,'bad>(x: &'a i8, y: &'bad i8) {
|
||||
| ---- first declared here
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:61:13
|
||||
@ -47,7 +47,7 @@ LL | impl <'bad, 'e> Enum<'bad, 'e> {
|
||||
| ---- first declared here
|
||||
LL | fn meth_bad(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:67:13
|
||||
@ -56,7 +56,7 @@ LL | impl <'d, 'bad> Enum<'d, 'bad> {
|
||||
| ---- first declared here
|
||||
LL | fn meth_bad2(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:73:13
|
||||
@ -64,7 +64,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
LL | fn meth_bad3<'bad>(x: &'bad i8) {
|
||||
| ---- first declared here
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:78:13
|
||||
@ -72,7 +72,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
LL | fn meth_bad4<'a,'bad>(x: &'bad i8) {
|
||||
| ---- first declared here
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:88:13
|
||||
@ -81,7 +81,7 @@ LL | trait HasDefaultMethod1<'bad> {
|
||||
| ---- first declared here
|
||||
...
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:94:13
|
||||
@ -90,7 +90,7 @@ LL | trait HasDefaultMethod2<'a,'bad> {
|
||||
| ---- first declared here
|
||||
LL | fn meth_bad(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
--> $DIR/loops-reject-labels-shadowing-lifetimes.rs:100:13
|
||||
@ -98,7 +98,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
LL | fn meth_bad<'bad>(&self) {
|
||||
| ---- first declared here
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
| ^^^^ lifetime `'bad` already in scope
|
||||
|
||||
warning: 12 warnings emitted
|
||||
|
||||
|
@ -4,7 +4,7 @@ warning: lifetime name `'a` shadows a label name that is already in scope
|
||||
LL | 'a: loop {
|
||||
| -- first declared here
|
||||
LL | let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>;
|
||||
| ^^ lifetime 'a already in scope
|
||||
| ^^ label `'a` already in scope
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
|
@ -2,7 +2,7 @@ warning: label name `'b` shadows a label name that is already in scope
|
||||
--> $DIR/macro-lifetime-used-with-labels.rs:21:9
|
||||
|
|
||||
LL | 'b: loop {
|
||||
| ^^ lifetime 'b already in scope
|
||||
| ^^ label `'b` already in scope
|
||||
...
|
||||
LL | 'b: loop {
|
||||
| -- first declared here
|
||||
|
@ -4,7 +4,7 @@ error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scop
|
||||
LL | impl<'a> Foo<'a> {
|
||||
| -- first declared here
|
||||
LL | fn shadow_in_method<'a>(&'a self) -> &'a isize {
|
||||
| ^^ lifetime 'a already in scope
|
||||
| ^^ lifetime `'a` already in scope
|
||||
|
||||
error[E0496]: lifetime name `'b` shadows a lifetime name that is already in scope
|
||||
--> $DIR/shadowed-lifetime.rs:12:20
|
||||
@ -12,7 +12,7 @@ error[E0496]: lifetime name `'b` shadows a lifetime name that is already in scop
|
||||
LL | fn shadow_in_type<'b>(&'b self) -> &'b isize {
|
||||
| -- first declared here
|
||||
LL | let x: for<'b> fn(&'b isize) = panic!();
|
||||
| ^^ lifetime 'b already in scope
|
||||
| ^^ lifetime `'b` already in scope
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user