16
16
#![ allow( dead_code, unused_variables) ]
17
17
18
18
fn foo ( ) {
19
- fn foo < ' a > ( ) { //~ NOTE shadowed lifetime `'a` declared here
19
+ fn foo < ' a > ( ) { //~ NOTE first declared here
20
20
' a: loop { break ' a; }
21
21
//~^ WARN label name `'a` shadows a lifetime name that is already in scope
22
+ //~| NOTE lifetime 'a already in scope
22
23
}
23
24
24
25
struct Struct < ' b , ' c > { _f : & ' b i8 , _g : & ' c i8 }
@@ -40,76 +41,87 @@ fn foo() {
40
41
}
41
42
}
42
43
43
- impl < ' bad , ' c > Struct < ' bad , ' c > { //~ NOTE shadowed lifetime `'bad` declared here
44
+ impl < ' bad , ' c > Struct < ' bad , ' c > { //~ NOTE first declared here
44
45
fn meth_bad ( & self ) {
45
46
' bad: loop { break ' bad; }
46
47
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
48
+ //~| NOTE lifetime 'bad already in scope
47
49
}
48
50
}
49
51
50
- impl < ' b , ' bad > Struct < ' b , ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
52
+ impl < ' b , ' bad > Struct < ' b , ' bad > { //~ NOTE first declared here
51
53
fn meth_bad2 ( & self ) {
52
54
' bad: loop { break ' bad; }
53
55
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
56
+ //~| NOTE lifetime 'bad already in scope
54
57
}
55
58
}
56
59
57
60
impl < ' b , ' c > Struct < ' b , ' c > {
58
- fn meth_bad3 < ' bad > ( x : & ' bad i8 ) { //~ NOTE shadowed lifetime `'bad` declared here
61
+ fn meth_bad3 < ' bad > ( x : & ' bad i8 ) { //~ NOTE first declared here
59
62
' bad: loop { break ' bad; }
60
63
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
64
+ //~| NOTE lifetime 'bad already in scope
61
65
}
62
66
63
67
fn meth_bad4 < ' a , ' bad > ( x : & ' a i8 , y : & ' bad i8 ) {
64
- //~^ NOTE shadowed lifetime `'bad` declared here
68
+ //~^ NOTE first declared here
65
69
' bad: loop { break ' bad; }
66
70
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
71
+ //~| NOTE lifetime 'bad already in scope
67
72
}
68
73
}
69
74
70
- impl < ' bad , ' e > Enum < ' bad , ' e > { //~ NOTE shadowed lifetime `'bad` declared here
75
+ impl < ' bad , ' e > Enum < ' bad , ' e > { //~ NOTE first declared here
71
76
fn meth_bad ( & self ) {
72
77
' bad: loop { break ' bad; }
73
78
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
79
+ //~| NOTE lifetime 'bad already in scope
74
80
}
75
81
}
76
- impl < ' d , ' bad > Enum < ' d , ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
82
+ impl < ' d , ' bad > Enum < ' d , ' bad > { //~ NOTE first declared here
77
83
fn meth_bad2 ( & self ) {
78
84
' bad: loop { break ' bad; }
79
85
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
86
+ //~| NOTE lifetime 'bad already in scope
80
87
}
81
88
}
82
89
impl < ' d , ' e > Enum < ' d , ' e > {
83
- fn meth_bad3 < ' bad > ( x : & ' bad i8 ) { //~ NOTE shadowed lifetime `'bad` declared here
90
+ fn meth_bad3 < ' bad > ( x : & ' bad i8 ) { //~ NOTE first declared here
84
91
' bad: loop { break ' bad; }
85
92
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
93
+ //~| NOTE lifetime 'bad already in scope
86
94
}
87
95
88
- fn meth_bad4 < ' a , ' bad > ( x : & ' bad i8 ) { //~ NOTE shadowed lifetime `'bad` declared here
96
+ fn meth_bad4 < ' a , ' bad > ( x : & ' bad i8 ) { //~ NOTE first declared here
89
97
' bad: loop { break ' bad; }
90
98
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
99
+ //~| NOTE lifetime 'bad already in scope
91
100
}
92
101
}
93
102
94
- trait HasDefaultMethod1 < ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
103
+ trait HasDefaultMethod1 < ' bad > { //~ NOTE first declared here
95
104
fn meth_okay ( ) {
96
105
' c: loop { break ' c; }
97
106
}
98
107
fn meth_bad ( & self ) {
99
108
' bad: loop { break ' bad; }
100
109
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
110
+ //~| NOTE lifetime 'bad already in scope
101
111
}
102
112
}
103
- trait HasDefaultMethod2 < ' a , ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
113
+ trait HasDefaultMethod2 < ' a , ' bad > { //~ NOTE first declared here
104
114
fn meth_bad ( & self ) {
105
115
' bad: loop { break ' bad; }
106
116
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
117
+ //~| NOTE lifetime 'bad already in scope
107
118
}
108
119
}
109
120
trait HasDefaultMethod3 < ' a , ' b > {
110
- fn meth_bad < ' bad > ( & self ) { //~ NOTE shadowed lifetime `'bad` declared here
121
+ fn meth_bad < ' bad > ( & self ) { //~ NOTE first declared here
111
122
' bad: loop { break ' bad; }
112
123
//~^ WARN label name `'bad` shadows a lifetime name that is already in scope
124
+ //~| NOTE lifetime 'bad already in scope
113
125
}
114
126
}
115
127
}
0 commit comments