2014-03-22 01:05:05 +00:00
|
|
|
#![allow(while_true)]
|
|
|
|
#![allow(dead_code)]
|
2013-04-30 05:15:17 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
struct A(isize);
|
2013-04-30 05:15:17 +00:00
|
|
|
|
|
|
|
impl A {
|
|
|
|
fn foo(&self) { while true {} }
|
|
|
|
|
|
|
|
#[deny(while_true)]
|
|
|
|
fn bar(&self) { while true {} } //~ ERROR: infinite loops
|
|
|
|
}
|
|
|
|
|
|
|
|
#[deny(while_true)]
|
|
|
|
mod foo {
|
2015-01-08 10:54:35 +00:00
|
|
|
struct B(isize);
|
2013-04-30 05:15:17 +00:00
|
|
|
|
|
|
|
impl B {
|
|
|
|
fn foo(&self) { while true {} } //~ ERROR: infinite loops
|
|
|
|
|
|
|
|
#[allow(while_true)]
|
|
|
|
fn bar(&self) { while true {} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[deny(while_true)]
|
|
|
|
fn main() {
|
|
|
|
while true {} //~ ERROR: infinite loops
|
|
|
|
}
|
2017-09-01 15:45:46 +00:00
|
|
|
|
|
|
|
#[deny(while_true)]
|
|
|
|
fn bar() {
|
|
|
|
while cfg!(unix) {} // no error
|
|
|
|
}
|