Tweak diagnostics on shadowing lifetimes/labels

This commit is contained in:
Yuki Okushi 2020-12-02 11:39:42 +09:00
parent 6645da366e
commit cdcce11504
13 changed files with 95 additions and 95 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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