Skip to content

Commit 335f91f

Browse files
committed
Revert "Allow unused_labels in some compile-fail tests"
This reverts commit b9257e2ca161b1bf5aae9d6b667f4d0c6b8d7be6.
1 parent a336aa9 commit 335f91f

10 files changed

+2
-16
lines changed

src/test/compile-fail/associated-types-outlives.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ fn denormalise<'a, T>(t: &'a T) -> <T as Foo<'a>>::Bar {
2727
pub fn free_and_use<T: for<'a> Foo<'a>,
2828
F: for<'a> FnOnce(<T as Foo<'a>>::Bar)>(x: T, f: F) {
2929
let y;
30-
#[allow(unused_labels)]
3130
'body: loop { // lifetime annotations added for clarity
3231
's: loop { y = denormalise(&x); break }
3332
drop(x); //~ ERROR cannot move out of `x` because it is borrowed

src/test/compile-fail/hygienic-label-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ macro_rules! foo {
1313
}
1414

1515
pub fn main() {
16-
#[allow(unused_labels)]
1716
'x: loop { foo!() }
1817
}

src/test/compile-fail/hygienic-label-2.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
// except according to those terms.
1010

1111
macro_rules! foo {
12-
($e: expr) => {
13-
#[allow(unused_labels)]
14-
'x: loop { $e }
15-
}
12+
($e: expr) => { 'x: loop { $e } }
1613
}
1714

1815
pub fn main() {

src/test/compile-fail/hygienic-label-3.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ macro_rules! foo {
1313
}
1414

1515
pub fn main() {
16-
#[allow(unused_labels)]
1716
'x: for _ in 0..1 {
1817
foo!()
1918
};

src/test/compile-fail/hygienic-label-4.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
// except according to those terms.
1010

1111
macro_rules! foo {
12-
($e: expr) => {
13-
#[allow(unused_labels)]
14-
'x: for _ in 0..1 { $e }
15-
}
12+
($e: expr) => { 'x: for _ in 0..1 { $e } }
1613
}
1714

1815
pub fn main() {

src/test/compile-fail/issue-27042.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// Regression test for #27042. Test that a loop's label is included in its span.
1212

13-
#[allow(unused_labels)]
1413
fn main() {
1514
let _: i32 =
1615
'a: // in this case, the citation is just the `break`:

src/test/compile-fail/issue-46311.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
#[allow(unused_labels)]
1312
'break: loop { //~ ERROR invalid label name `'break`
1413
}
1514
}

src/test/compile-fail/loop-break-value.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ fn main() {
7777
}
7878

7979
let _: i32 = 'a: loop {
80-
#[allow(unused_labels)]
8180
let _: () = 'b: loop {
8281
break ('c: loop {
8382
break;

src/test/compile-fail/loop-proper-liveness.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ fn test2() {
3232
fn test3() {
3333
let x: i32;
3434
// Similarly, the use of variable `x` is unreachable.
35-
#[allow(unused_labels)]
3635
'a: loop {
3736
x = loop { return };
3837
}

src/test/compile-fail/resolve-label.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[allow(unused_labels)]
1211
fn f() {
1312
'l: loop {
1413
fn g() {

0 commit comments

Comments
 (0)