]> git.lizzy.rs Git - rust.git/blob - src/test/ui/loops/loops-reject-labels-shadowing-lifetimes.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / loops / loops-reject-labels-shadowing-lifetimes.stderr
1 warning: label name `'a` shadows a lifetime name that is already in scope
2   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:20:9
3    |
4 LL |     fn foo<'a>() {
5    |            -- first declared here
6 LL |         'a: loop { break 'a; }
7    |         ^^ lifetime 'a already in scope
8
9 warning: label name `'bad` shadows a lifetime name that is already in scope
10   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:45:13
11    |
12 LL |     impl<'bad, 'c> Struct<'bad, 'c> {
13    |          ---- first declared here
14 LL |         fn meth_bad(&self) {
15 LL |             'bad: loop { break 'bad; }
16    |             ^^^^ lifetime 'bad already in scope
17
18 warning: label name `'bad` shadows a lifetime name that is already in scope
19   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:52:13
20    |
21 LL |     impl<'b, 'bad> Struct<'b, 'bad> {
22    |              ---- first declared here
23 LL |         fn meth_bad2(&self) {
24 LL |             'bad: loop { break 'bad; }
25    |             ^^^^ lifetime 'bad already in scope
26
27 warning: label name `'bad` shadows a lifetime name that is already in scope
28   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:59:13
29    |
30 LL |         fn meth_bad3<'bad>(x: &'bad i8) {
31    |                      ---- first declared here
32 LL |             'bad: loop { break 'bad; }
33    |             ^^^^ lifetime 'bad already in scope
34
35 warning: label name `'bad` shadows a lifetime name that is already in scope
36   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:64:13
37    |
38 LL |         fn meth_bad4<'a,'bad>(x: &'a i8, y: &'bad i8) {
39    |                         ---- first declared here
40 LL |             'bad: loop { break 'bad; }
41    |             ^^^^ lifetime 'bad already in scope
42
43 warning: label name `'bad` shadows a lifetime name that is already in scope
44   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:71:13
45    |
46 LL |     impl <'bad, 'e> Enum<'bad, 'e> {
47    |           ---- first declared here
48 LL |         fn meth_bad(&self) {
49 LL |             'bad: loop { break 'bad; }
50    |             ^^^^ lifetime 'bad already in scope
51
52 warning: label name `'bad` shadows a lifetime name that is already in scope
53   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:77:13
54    |
55 LL |     impl <'d, 'bad> Enum<'d, 'bad> {
56    |               ---- first declared here
57 LL |         fn meth_bad2(&self) {
58 LL |             'bad: loop { break 'bad; }
59    |             ^^^^ lifetime 'bad already in scope
60
61 warning: label name `'bad` shadows a lifetime name that is already in scope
62   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:83:13
63    |
64 LL |         fn meth_bad3<'bad>(x: &'bad i8) {
65    |                      ---- first declared here
66 LL |             'bad: loop { break 'bad; }
67    |             ^^^^ lifetime 'bad already in scope
68
69 warning: label name `'bad` shadows a lifetime name that is already in scope
70   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:88:13
71    |
72 LL |         fn meth_bad4<'a,'bad>(x: &'bad i8) {
73    |                         ---- first declared here
74 LL |             'bad: loop { break 'bad; }
75    |             ^^^^ lifetime 'bad already in scope
76
77 warning: label name `'bad` shadows a lifetime name that is already in scope
78   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:98:13
79    |
80 LL |     trait HasDefaultMethod1<'bad> {
81    |                             ---- first declared here
82 ...
83 LL |             'bad: loop { break 'bad; }
84    |             ^^^^ lifetime 'bad already in scope
85
86 warning: label name `'bad` shadows a lifetime name that is already in scope
87   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:104:13
88    |
89 LL |     trait HasDefaultMethod2<'a,'bad> {
90    |                                ---- first declared here
91 LL |         fn meth_bad(&self) {
92 LL |             'bad: loop { break 'bad; }
93    |             ^^^^ lifetime 'bad already in scope
94
95 warning: label name `'bad` shadows a lifetime name that is already in scope
96   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:110:13
97    |
98 LL |         fn meth_bad<'bad>(&self) {
99    |                     ---- first declared here
100 LL |             'bad: loop { break 'bad; }
101    |             ^^^^ lifetime 'bad already in scope
102
103 error: compilation successful
104   --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:117:1
105    |
106 LL | / pub fn main() { //~ ERROR compilation successful
107 LL | |     foo();
108 LL | | }
109    | |_^
110
111 error: aborting due to previous error
112