]> git.lizzy.rs Git - rust.git/commitdiff
Bless tests.
authorCamille GILLOT <gillot.camille@gmail.com>
Wed, 8 Dec 2021 21:40:16 +0000 (22:40 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Thu, 2 Jun 2022 17:24:10 +0000 (19:24 +0200)
16 files changed:
src/test/ui/error-codes/E0263.stderr
src/test/ui/generic-associated-types/shadowing.stderr
src/test/ui/hygiene/duplicate_lifetimes.stderr
src/test/ui/hygiene/hygienic-labels-in-let.rs
src/test/ui/hygiene/hygienic-labels-in-let.stderr
src/test/ui/hygiene/hygienic-labels.rs
src/test/ui/hygiene/hygienic-labels.stderr
src/test/ui/label/label_misspelled.stderr
src/test/ui/label/label_misspelled_2.stderr
src/test/ui/lint/unused_labels.rs
src/test/ui/lint/unused_labels.stderr
src/test/ui/loops/loop-break-value.stderr
src/test/ui/macros/macro-lifetime-used-with-labels.rs
src/test/ui/macros/macro-lifetime-used-with-labels.stderr [deleted file]
src/test/ui/regions/regions-name-duplicated.rs
src/test/ui/regions/regions-name-duplicated.stderr

index 4dae02b85c36ca82f419080dc24e5e3e54a10a57..56e4ef023794f9accd534d8794831265a30bbc72 100644 (file)
@@ -2,9 +2,9 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
   --> $DIR/E0263.rs:1:16
    |
 LL | fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
-   |        --      ^^ declared twice
+   |        --      ^^ lifetime `'a` already in scope
    |        |
-   |        previous declaration here
+   |        first declared here
 
 error: aborting due to previous error
 
index 857757f8940dc41668d6f0de58e4376e7217dc46..be765920975b3703ae2ad55f073f42ebdc5d6801 100644 (file)
@@ -1,3 +1,19 @@
+error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
+  --> $DIR/shadowing.rs:4:14
+   |
+LL | trait Shadow<'a> {
+   |              -- first declared here
+LL |     type Bar<'a>;
+   |              ^^ lifetime `'a` already in scope
+
+error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
+  --> $DIR/shadowing.rs:13:14
+   |
+LL | impl<'a> NoShadow<'a> for &'a u32 {
+   |      -- first declared here
+LL |     type Bar<'a> = i32;
+   |              ^^ lifetime `'a` already in scope
+
 error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   --> $DIR/shadowing.rs:18:14
    |
@@ -14,22 +30,6 @@ LL | impl<T> NoShadowT<T> for Option<T> {
 LL |     type Bar<T> = i32;
    |              ^ already used
 
-error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
-  --> $DIR/shadowing.rs:13:14
-   |
-LL | impl<'a> NoShadow<'a> for &'a u32 {
-   |      -- first declared here
-LL |     type Bar<'a> = i32;
-   |              ^^ lifetime `'a` already in scope
-
-error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
-  --> $DIR/shadowing.rs:4:14
-   |
-LL | trait Shadow<'a> {
-   |              -- first declared here
-LL |     type Bar<'a>;
-   |              ^^ lifetime `'a` already in scope
-
 error: aborting due to 4 previous errors
 
 Some errors have detailed explanations: E0403, E0496.
index 4d41ebaa4373359c2ba8837f9bc4aa72974f1110..ade411a25442b3af623a3ba60298bf3d8e92acea 100644 (file)
@@ -2,12 +2,12 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
   --> $DIR/duplicate_lifetimes.rs:8:14
    |
 LL |     fn g<$a, 'a>() {}
-   |              ^^ declared twice
+   |              ^^ lifetime `'a` already in scope
 ...
 LL | m!('a);
    | ------
    | |  |
-   | |  previous declaration here
+   | |  first declared here
    | in this macro invocation
    |
    = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -16,12 +16,12 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
   --> $DIR/duplicate_lifetimes.rs:13:14
    |
 LL |     fn h<$a, 'a>() {}
-   |              ^^ declared twice
+   |              ^^ lifetime `'a` already in scope
 ...
 LL | n!('a);
    | ------
    | |  |
-   | |  previous declaration here
+   | |  first declared here
    | in this macro invocation
    |
    = note: this error originates in the macro `n` (in Nightly builds, run with -Z macro-backtrace for more info)
index 491855d7becd153cd14b1051767942c9b96a6ee5..19f72f24459b323fb395ee1a3d0dbbc5dc107de5 100644 (file)
 macro_rules! loop_x {
     ($e: expr) => {
         // $e shouldn't be able to interact with this 'x
-        'x: loop { $e }
-        //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-    }
+        'x: loop {
+            $e
+        }
+    };
 }
 
 macro_rules! while_true {
     ($e: expr) => {
         // $e shouldn't be able to interact with this 'x
-        'x: while 1 + 1 == 2 { $e }
-        //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-    }
+        'x: while 1 + 1 == 2 {
+            $e
+        }
+    };
 }
 
 macro_rules! run_once {
     ($e: expr) => {
         // ditto
-        'x: for _ in 0..1 { $e }
-        //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-    }
+        'x: for _ in 0..1 {
+            $e
+        }
+    };
 }
 
 pub fn main() {
@@ -63,7 +53,6 @@ pub fn main() {
     let k: isize = {
         'x: for _ in 0..1 {
             //~^ WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
             // ditto
             loop_x!(break 'x);
             i += 1;
@@ -75,9 +64,6 @@ pub fn main() {
     let l: isize = {
         'x: for _ in 0..1 {
             //~^ WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
             // ditto
             while_true!(break 'x);
             i += 1;
@@ -89,11 +75,6 @@ pub fn main() {
     let n: isize = {
         'x: for _ in 0..1 {
             //~^ WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
-            //~| WARNING shadows a label name that is already in scope
             // ditto
             run_once!(continue 'x);
             i += 1;
index 519e3c0880ac66e90b8dd44447a3ec4abaca082b..e1c284600ea23db89da44cab509cb21fdbe68c39 100644 (file)
 warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:16:9
+  --> $DIR/hygienic-labels-in-let.rs:54:9
    |
-LL |         'x: loop { $e }
-   |         ^^ label `'x` already in scope
-...
 LL |         'x: loop {
    |         -- first declared here
-LL |             // this 'x should refer to the outer loop, lexically
-LL |             loop_x!(break 'x);
-   |             ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:64:9
-   |
-LL |         'x: loop {
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
 ...
 LL |         'x: for _ in 0..1 {
    |         ^^ 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
+  --> $DIR/hygienic-labels-in-let.rs:65:9
    |
-LL |         'x: loop { $e }
-   |         ^^ label `'x` already in scope
-...
 LL |         'x: loop {
    |         -- first declared here
 ...
-LL |             loop_x!(break 'x);
-   |             ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^
-   |         |
-   |         first declared here
-   |         label `'x` already in scope
-...
-LL |             loop_x!(break 'x);
-   |             ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |             loop_x!(break 'x);
-   |             ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:76:9
-   |
-LL |         'x: loop {
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
 LL |         'x: for _ in 0..1 {
    |         ^^ 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
    |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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 }
-   |         ^^ label `'x` already in scope
-...
 LL |         'x: loop {
    |         -- first declared here
 ...
-LL |             while_true!(break 'x);
-   |             --------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:27:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |             while_true!(break 'x);
-   |             --------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
 LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |             while_true!(break 'x);
-   |             --------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:27:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: while 1 + 1 == 2 { $e }
    |         ^^ label `'x` already in scope
-...
-LL |             while_true!(break 'x);
-   |             --------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |             while_true!(break 'x);
-   |             --------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:90:9
-   |
-LL |         'x: loop {
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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
-   |
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 {
-   |         ^^ 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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: loop {
-   |         -- first declared here
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:39:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:39:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels-in-let.rs:39:9
-   |
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: for _ in 0..1 {
-   |         -- first declared here
-...
-LL |             run_once!(continue 'x);
-   |             ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-warning: 28 warnings emitted
+warning: 3 warnings emitted
 
index c9f494b68b4a812a5e73599bfec24b70a2127d7f..af8f928527347dd14c7e0c6e8818e3f21179e00d 100644 (file)
 macro_rules! loop_x {
     ($e: expr) => {
         // $e shouldn't be able to interact with this 'x
-        'x: loop { $e }
-        //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-    }
+        'x: loop {
+            $e
+        }
+    };
 }
 
 macro_rules! run_once {
     ($e: expr) => {
         // ditto
-        'x: for _ in 0..1 { $e }
-        //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-    }
+        'x: for _ in 0..1 {
+            $e
+        }
+    };
 }
 
 macro_rules! while_x {
     ($e: expr) => {
         // ditto
-        'x: while 1 + 1 == 2 { $e }
-        //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-    }
+        'x: while 1 + 1 == 2 {
+            $e
+        }
+    };
 }
 
 pub fn main() {
@@ -53,7 +43,6 @@ pub fn main() {
 
     'x: loop {
         //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
 
         // ditto
         loop_x!(break 'x);
@@ -62,9 +51,6 @@ pub fn main() {
 
     'x: while 1 + 1 == 2 {
         //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
 
         while_x!(break 'x);
         panic!("break doesn't act hygienically inside infinite while loop");
@@ -72,11 +58,6 @@ pub fn main() {
 
     'x: for _ in 0..1 {
         //~^ WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
-        //~| WARNING shadows a label name that is already in scope
 
         // ditto
         run_once!(continue 'x);
index f0b891fe34979e0dd2b783f4f23e3fd9e9b331cf..df1f3c701904b724257937415fb8cd87e6b09e58 100644 (file)
@@ -1,79 +1,14 @@
 warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:13:9
+  --> $DIR/hygienic-labels.rs:44:5
    |
-LL |         'x: loop { $e }
-   |         ^^ label `'x` already in scope
-...
 LL |     'x: for _ in 0..1 {
    |     -- first declared here
-LL |         // this 'x should refer to the outer loop, lexically
-LL |         loop_x!(break 'x);
-   |         ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:54:5
-   |
-LL |     'x: for _ in 0..1 {
-   |     -- first declared here
-...
-LL |     'x: loop {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:54:5
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
 ...
 LL |     'x: loop {
    |     ^^ 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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: for _ in 0..1 {
-   |     -- first declared here
-...
-LL |         loop_x!(break 'x);
-   |         ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:13:9
-   |
-LL |         'x: loop { $e }
-   |         ^^
-   |         |
-   |         first declared here
-   |         label `'x` already in scope
-...
-LL |         loop_x!(break 'x);
-   |         ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:13:9
-   |
-LL |         'x: loop { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: loop {
-   |     -- first declared here
-...
-LL |         loop_x!(break 'x);
-   |         ----------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:63:5
+  --> $DIR/hygienic-labels.rs:52:5
    |
 LL |     'x: for _ in 0..1 {
    |     -- first declared here
@@ -82,253 +17,13 @@ LL |     'x: while 1 + 1 == 2 {
    |     ^^ label `'x` already in scope
 
 warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:63:5
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |     'x: while 1 + 1 == 2 {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:63:5
-   |
-LL |     'x: loop {
-   |     -- first declared here
-...
-LL |     'x: while 1 + 1 == 2 {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:63:5
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |     'x: while 1 + 1 == 2 {
-   |     ^^ 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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: for _ in 0..1 {
-   |     -- first declared here
-...
-LL |         while_x!(break 'x);
-   |         ------------------ in this macro invocation
-   |
-   = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:38:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |         while_x!(break 'x);
-   |         ------------------ in this macro invocation
-   |
-   = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: loop {
-   |     -- first declared here
-...
-LL |         while_x!(break 'x);
-   |         ------------------ in this macro invocation
-   |
-   = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:38:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |         while_x!(break 'x);
-   |         ------------------ in this macro invocation
-   |
-   = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: while 1 + 1 == 2 {
-   |     -- first declared here
-...
-LL |         while_x!(break 'x);
-   |         ------------------ in this macro invocation
-   |
-   = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:73:5
-   |
-LL |     'x: for _ in 0..1 {
-   |     -- first declared here
-...
-LL |     'x: for _ in 0..1 {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:73:5
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |     'x: for _ in 0..1 {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:73:5
-   |
-LL |     'x: loop {
-   |     -- first declared here
-...
-LL |     'x: for _ in 0..1 {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:73:5
+  --> $DIR/hygienic-labels.rs:59:5
    |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
 LL |     'x: for _ in 0..1 {
-   |     ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:73:5
-   |
-LL |     'x: while 1 + 1 == 2 {
    |     -- first declared here
 ...
 LL |     'x: for _ in 0..1 {
    |     ^^ label `'x` already in scope
 
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:73:5
-   |
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         -- first declared here
-...
-LL |     'x: for _ in 0..1 {
-   |     ^^ 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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: for _ in 0..1 {
-   |     -- first declared here
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:24:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: loop {
-   |     -- first declared here
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
-  --> $DIR/hygienic-labels.rs:24:9
-   |
-LL |         'x: loop { $e }
-   |         -- first declared here
-...
-LL |         'x: for _ in 0..1 { $e }
-   |         ^^ label `'x` already in scope
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: while 1 + 1 == 2 {
-   |     -- first declared here
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |         'x: while 1 + 1 == 2 { $e }
-   |         -- first declared here
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-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 }
-   |         ^^ label `'x` already in scope
-...
-LL |     'x: for _ in 0..1 {
-   |     -- first declared here
-...
-LL |         run_once!(continue 'x);
-   |         ---------------------- in this macro invocation
-   |
-   = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: 28 warnings emitted
+warning: 3 warnings emitted
 
index 4b5b9e92ca09a5ab244ac9c384bf6f525eeb6438..9d42aaa58cb216bd0d55622c01142454b61819b4 100644 (file)
@@ -2,7 +2,10 @@ error[E0425]: cannot find value `while_loop` in this scope
   --> $DIR/label_misspelled.rs:6:9
    |
 LL |     'while_loop: while true {
-   |     ----------- a label with a similar name exists
+   |     -----------
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |
 LL |         while_loop;
    |         ^^^^^^^^^^ not found in this scope
@@ -11,7 +14,10 @@ error[E0425]: cannot find value `while_let` in this scope
   --> $DIR/label_misspelled.rs:11:9
    |
 LL |     'while_let: while let Some(_) = Some(()) {
-   |     ---------- a label with a similar name exists
+   |     ----------
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |
 LL |         while_let;
    |         ^^^^^^^^^ not found in this scope
@@ -20,7 +26,10 @@ error[E0425]: cannot find value `for_loop` in this scope
   --> $DIR/label_misspelled.rs:16:9
    |
 LL |     'for_loop: for _ in 0..3 {
-   |     --------- a label with a similar name exists
+   |     ---------
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |
 LL |         for_loop;
    |         ^^^^^^^^ not found in this scope
@@ -29,7 +38,10 @@ error[E0425]: cannot find value `LOOP` in this scope
   --> $DIR/label_misspelled.rs:21:9
    |
 LL |     'LOOP: loop {
-   |     ----- a label with a similar name exists
+   |     -----
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |
 LL |         LOOP;
    |         ^^^^ not found in this scope
@@ -38,45 +50,81 @@ error[E0425]: cannot find value `LOOP` in this scope
   --> $DIR/label_misspelled.rs:28:15
    |
 LL |     'LOOP: loop {
-   |     ----- a label with a similar name exists
+   |     -----
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break LOOP;
-   |               ^^^^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'LOOP`
+   |               ^^^^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'LOOP;
+   |               ~~~~~
+help: use the similarly named label
+   |
+LL |         break 'LOOP;
+   |               ~~~~~
 
 error[E0425]: cannot find value `while_loop` in this scope
   --> $DIR/label_misspelled.rs:32:15
    |
 LL |     'while_loop: while true {
-   |     ----------- a label with a similar name exists
+   |     -----------
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break while_loop;
-   |               ^^^^^^^^^^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'while_loop`
+   |               ^^^^^^^^^^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'while_loop;
+   |               ~~~~~~~~~~~
+help: use the similarly named label
+   |
+LL |         break 'while_loop;
+   |               ~~~~~~~~~~~
 
 error[E0425]: cannot find value `while_let` in this scope
   --> $DIR/label_misspelled.rs:36:15
    |
 LL |     'while_let: while let Some(_) = Some(()) {
-   |     ---------- a label with a similar name exists
+   |     ----------
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break while_let;
-   |               ^^^^^^^^^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'while_let`
+   |               ^^^^^^^^^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'while_let;
+   |               ~~~~~~~~~~
+help: use the similarly named label
+   |
+LL |         break 'while_let;
+   |               ~~~~~~~~~~
 
 error[E0425]: cannot find value `for_loop` in this scope
   --> $DIR/label_misspelled.rs:40:15
    |
 LL |     'for_loop: for _ in 0..3 {
-   |     --------- a label with a similar name exists
+   |     ---------
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break for_loop;
-   |               ^^^^^^^^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'for_loop`
+   |               ^^^^^^^^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'for_loop;
+   |               ~~~~~~~~~
+help: use the similarly named label
+   |
+LL |         break 'for_loop;
+   |               ~~~~~~~~~
 
 warning: unused label
   --> $DIR/label_misspelled.rs:4:5
index 960646d9894d1158774e6d5369ecd7e350e24c38..b618690340bb278bd8c7c5ef9ba9762ed4f0f6c7 100644 (file)
@@ -14,23 +14,41 @@ error[E0425]: cannot find value `b` in this scope
   --> $DIR/label_misspelled_2.rs:8:15
    |
 LL |     'b: for _ in 0..1 {
-   |     -- a label with a similar name exists
+   |     --
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break b;
-   |               ^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'b`
+   |               ^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'b;
+   |               ~~
+help: use the similarly named label
+   |
+LL |         break 'b;
+   |               ~~
 
 error[E0425]: cannot find value `d` in this scope
   --> $DIR/label_misspelled_2.rs:14:15
    |
 LL |     d: for _ in 0..1 {
-   |     - a label with a similar name exists
+   |     -
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break d;
-   |               ^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'d`
+   |               ^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'd;
+   |               ~~
+help: use the similarly named label
+   |
+LL |         break 'd;
+   |               ~~
 
 error: aborting due to 4 previous errors
 
index 8a3568f65f63e078c48aaecfba8ac3d633bd1036..fb9a9ae2648a692bf0c56cb613b36baee97095bc 100644 (file)
@@ -61,6 +61,7 @@ fn main() {
         //~^ WARN unused label
         'many_used_shadowed: for _ in 0..10 {
             //~^ WARN label name `'many_used_shadowed` shadows a label name that is already in scope
+            //~| WARN label name `'many_used_shadowed` shadows a label name that is already in scope
             if 1 % 2 == 0 {
                 break 'many_used_shadowed;
             } else {
index 4bb1a437d2409c79d5b9dcf04695d6b4f8437c15..ed9287d54a44e4b3f91c7c52876fec5d1f39a1c1 100644 (file)
@@ -1,3 +1,21 @@
+warning: label name `'many_used_shadowed` shadows a label name that is already in scope
+  --> $DIR/unused_labels.rs:62:9
+   |
+LL |     'many_used_shadowed: for _ in 0..10 {
+   |     ------------------- first declared here
+LL |
+LL |         'many_used_shadowed: for _ in 0..10 {
+   |         ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
+
+warning: label name `'many_used_shadowed` shadows a label name that is already in scope
+  --> $DIR/unused_labels.rs:62:9
+   |
+LL |     'many_used_shadowed: for _ in 0..10 {
+   |     ------------------- first declared here
+LL |
+LL |         'many_used_shadowed: for _ in 0..10 {
+   |         ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
+
 warning: unused label
   --> $DIR/unused_labels.rs:11:5
    |
@@ -41,25 +59,16 @@ LL |     'many_used_shadowed: for _ in 0..10 {
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused label
-  --> $DIR/unused_labels.rs:72:5
+  --> $DIR/unused_labels.rs:73:5
    |
 LL |     'unused_loop_label: loop {
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused label
-  --> $DIR/unused_labels.rs:78:5
+  --> $DIR/unused_labels.rs:79:5
    |
 LL |     'unused_block_label: {
    |     ^^^^^^^^^^^^^^^^^^^
 
-warning: label name `'many_used_shadowed` shadows a label name that is already in scope
-  --> $DIR/unused_labels.rs:62:9
-   |
-LL |     'many_used_shadowed: for _ in 0..10 {
-   |     ------------------- first declared here
-LL |
-LL |         'many_used_shadowed: for _ in 0..10 {
-   |         ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
-
-warning: 9 warnings emitted
+warning: 10 warnings emitted
 
index ccb27c3507076897e7a680350bcebce21bb98c55..5698c2693b5ee68fea15b43432b712d42e55a508 100644 (file)
@@ -2,12 +2,21 @@ error[E0425]: cannot find value `LOOP` in this scope
   --> $DIR/loop-break-value.rs:95:15
    |
 LL |     'LOOP: for _ in 0 .. 9 {
-   |     ----- a label with a similar name exists
+   |     -----
+   |     |
+   |     a label with a similar name exists
+   |     a label with a similar name exists
 LL |         break LOOP;
-   |               ^^^^
-   |               |
-   |               not found in this scope
-   |               help: use the similarly named label: `'LOOP`
+   |               ^^^^ not found in this scope
+   |
+help: use the similarly named label
+   |
+LL |         break 'LOOP;
+   |               ~~~~~
+help: use the similarly named label
+   |
+LL |         break 'LOOP;
+   |               ~~~~~
 
 warning: denote infinite loops with `loop { ... }`
   --> $DIR/loop-break-value.rs:26:5
index 2e9da6f9dc88c4cbce392717a3740df743cd43fb..59017da3b696ee3385502b1322673683efecd574 100644 (file)
@@ -18,7 +18,7 @@ macro_rules! br {
 }
 macro_rules! br2 {
     ($b:lifetime) => {
-        'b: loop { //~ WARNING `'b` shadows a label name that is already in scope
+        'b: loop {
             break $b; // this $b should refer to the outer loop.
         }
     }
diff --git a/src/test/ui/macros/macro-lifetime-used-with-labels.stderr b/src/test/ui/macros/macro-lifetime-used-with-labels.stderr
deleted file mode 100644 (file)
index 69334e2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-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 {
-   |         ^^ label `'b` already in scope
-...
-LL |     'b: loop {
-   |     -- first declared here
-LL |         br2!('b);
-   |         -------- in this macro invocation
-   |
-   = note: this warning originates in the macro `br2` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: 1 warning emitted
-
index f2adf01531569e4a5de3a7ad92385b47cb3395ba..ee9549991ce24b159265212b9298617bfac0ca40 100644 (file)
@@ -1,5 +1,7 @@
-struct Foo<'a, 'a> { //~ ERROR lifetime name `'a` declared twice
-    x: &'a isize
+struct Foo<'a, 'a> {
+    //~^ ERROR lifetime name `'a` declared twice
+    //~| ERROR parameter `'a` is never used [E0392]
+    x: &'a isize,
 }
 
 fn main() {}
index a7e03a61adcf59c10804cac62e8f54cb93b24e29..6d6e28c8479e55105d5a48d5333a1daf8eb8d4fa 100644 (file)
@@ -2,10 +2,19 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
   --> $DIR/regions-name-duplicated.rs:1:16
    |
 LL | struct Foo<'a, 'a> {
-   |            --  ^^ declared twice
+   |            --  ^^ lifetime `'a` already in scope
    |            |
-   |            previous declaration here
+   |            first declared here
 
-error: aborting due to previous error
+error[E0392]: parameter `'a` is never used
+  --> $DIR/regions-name-duplicated.rs:1:12
+   |
+LL | struct Foo<'a, 'a> {
+   |            ^^ unused parameter
+   |
+   = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0263`.
+Some errors have detailed explanations: E0263, E0392.
+For more information about an error, try `rustc --explain E0263`.