2017-11-10 14:11:25 +03:00
|
|
|
fn ok() {
|
|
|
|
loop {
|
|
|
|
let _x = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-27 08:06:36 +00:00
|
|
|
fn also_ok() {
|
|
|
|
loop {
|
|
|
|
let _x = String::new();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-10 14:11:25 +03:00
|
|
|
fn fail() {
|
|
|
|
loop {
|
|
|
|
let x: i32;
|
2019-05-02 18:34:15 -04:00
|
|
|
let _ = x + 1; //~ERROR [E0381]
|
2017-11-10 14:11:25 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
ok();
|
2017-11-27 08:06:36 +00:00
|
|
|
also_ok();
|
2017-11-10 14:11:25 +03:00
|
|
|
fail();
|
|
|
|
}
|