1616#![ allow( dead_code, unused_variables) ]
1717
1818fn foo ( ) {
19- fn foo < ' a > ( ) { //~ NOTE shadowed lifetime `'a` declared here
19+ fn foo < ' a > ( ) { //~ NOTE first declared here
2020 ' a: loop { break ' a; }
2121 //~^ WARN label name `'a` shadows a lifetime name that is already in scope
22+ //~| NOTE lifetime 'a already in scope
2223 }
2324
2425 struct Struct < ' b , ' c > { _f : & ' b i8 , _g : & ' c i8 }
@@ -40,76 +41,87 @@ fn foo() {
4041 }
4142 }
4243
43- impl < ' bad , ' c > Struct < ' bad , ' c > { //~ NOTE shadowed lifetime `'bad` declared here
44+ impl < ' bad , ' c > Struct < ' bad , ' c > { //~ NOTE first declared here
4445 fn meth_bad ( & self ) {
4546 ' bad: loop { break ' bad; }
4647 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
48+ //~| NOTE lifetime 'bad already in scope
4749 }
4850 }
4951
50- impl < ' b , ' bad > Struct < ' b , ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
52+ impl < ' b , ' bad > Struct < ' b , ' bad > { //~ NOTE first declared here
5153 fn meth_bad2 ( & self ) {
5254 ' bad: loop { break ' bad; }
5355 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
56+ //~| NOTE lifetime 'bad already in scope
5457 }
5558 }
5659
5760 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
5962 ' bad: loop { break ' bad; }
6063 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
64+ //~| NOTE lifetime 'bad already in scope
6165 }
6266
6367 fn meth_bad4 < ' a , ' bad > ( x : & ' a i8 , y : & ' bad i8 ) {
64- //~^ NOTE shadowed lifetime `'bad` declared here
68+ //~^ NOTE first declared here
6569 ' bad: loop { break ' bad; }
6670 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
71+ //~| NOTE lifetime 'bad already in scope
6772 }
6873 }
6974
70- impl < ' bad , ' e > Enum < ' bad , ' e > { //~ NOTE shadowed lifetime `'bad` declared here
75+ impl < ' bad , ' e > Enum < ' bad , ' e > { //~ NOTE first declared here
7176 fn meth_bad ( & self ) {
7277 ' bad: loop { break ' bad; }
7378 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
79+ //~| NOTE lifetime 'bad already in scope
7480 }
7581 }
76- impl < ' d , ' bad > Enum < ' d , ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
82+ impl < ' d , ' bad > Enum < ' d , ' bad > { //~ NOTE first declared here
7783 fn meth_bad2 ( & self ) {
7884 ' bad: loop { break ' bad; }
7985 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
86+ //~| NOTE lifetime 'bad already in scope
8087 }
8188 }
8289 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
8491 ' bad: loop { break ' bad; }
8592 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
93+ //~| NOTE lifetime 'bad already in scope
8694 }
8795
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
8997 ' bad: loop { break ' bad; }
9098 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
99+ //~| NOTE lifetime 'bad already in scope
91100 }
92101 }
93102
94- trait HasDefaultMethod1 < ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
103+ trait HasDefaultMethod1 < ' bad > { //~ NOTE first declared here
95104 fn meth_okay ( ) {
96105 ' c: loop { break ' c; }
97106 }
98107 fn meth_bad ( & self ) {
99108 ' bad: loop { break ' bad; }
100109 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
110+ //~| NOTE lifetime 'bad already in scope
101111 }
102112 }
103- trait HasDefaultMethod2 < ' a , ' bad > { //~ NOTE shadowed lifetime `'bad` declared here
113+ trait HasDefaultMethod2 < ' a , ' bad > { //~ NOTE first declared here
104114 fn meth_bad ( & self ) {
105115 ' bad: loop { break ' bad; }
106116 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
117+ //~| NOTE lifetime 'bad already in scope
107118 }
108119 }
109120 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
111122 ' bad: loop { break ' bad; }
112123 //~^ WARN label name `'bad` shadows a lifetime name that is already in scope
124+ //~| NOTE lifetime 'bad already in scope
113125 }
114126 }
115127}
0 commit comments