Revert "Allow unused_labels in some compile-fail tests"
This reverts commit b9257e2ca161b1bf5aae9d6b667f4d0c6b8d7be6.
This commit is contained in:
parent
a336aa91db
commit
335f91fd69
10 changed files with 2 additions and 16 deletions
|
|
@ -27,7 +27,6 @@ fn denormalise<'a, T>(t: &'a T) -> <T as Foo<'a>>::Bar {
|
|||
pub fn free_and_use<T: for<'a> Foo<'a>,
|
||||
F: for<'a> FnOnce(<T as Foo<'a>>::Bar)>(x: T, f: F) {
|
||||
let y;
|
||||
#[allow(unused_labels)]
|
||||
'body: loop { // lifetime annotations added for clarity
|
||||
's: loop { y = denormalise(&x); break }
|
||||
drop(x); //~ ERROR cannot move out of `x` because it is borrowed
|
||||
|
|
|
|||
|
|
@ -13,6 +13,5 @@ macro_rules! foo {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
#[allow(unused_labels)]
|
||||
'x: loop { foo!() }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
macro_rules! foo {
|
||||
($e: expr) => {
|
||||
#[allow(unused_labels)]
|
||||
'x: loop { $e }
|
||||
}
|
||||
($e: expr) => { 'x: loop { $e } }
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ macro_rules! foo {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
#[allow(unused_labels)]
|
||||
'x: for _ in 0..1 {
|
||||
foo!()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
macro_rules! foo {
|
||||
($e: expr) => {
|
||||
#[allow(unused_labels)]
|
||||
'x: for _ in 0..1 { $e }
|
||||
}
|
||||
($e: expr) => { 'x: for _ in 0..1 { $e } }
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
// Regression test for #27042. Test that a loop's label is included in its span.
|
||||
|
||||
#[allow(unused_labels)]
|
||||
fn main() {
|
||||
let _: i32 =
|
||||
'a: // in this case, the citation is just the `break`:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
#[allow(unused_labels)]
|
||||
'break: loop { //~ ERROR invalid label name `'break`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ fn main() {
|
|||
}
|
||||
|
||||
let _: i32 = 'a: loop {
|
||||
#[allow(unused_labels)]
|
||||
let _: () = 'b: loop {
|
||||
break ('c: loop {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ fn test2() {
|
|||
fn test3() {
|
||||
let x: i32;
|
||||
// Similarly, the use of variable `x` is unreachable.
|
||||
#[allow(unused_labels)]
|
||||
'a: loop {
|
||||
x = loop { return };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unused_labels)]
|
||||
fn f() {
|
||||
'l: loop {
|
||||
fn g() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue