2017-11-19 16:37:59 -06:00
|
|
|
// compile-flags: -Z borrowck=compare
|
2017-11-10 05:11:25 -06:00
|
|
|
|
|
|
|
fn ok() {
|
|
|
|
loop {
|
|
|
|
let _x = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-27 02:06:36 -06:00
|
|
|
fn also_ok() {
|
|
|
|
loop {
|
|
|
|
let _x = String::new();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-10 05:11:25 -06:00
|
|
|
fn fail() {
|
|
|
|
loop {
|
|
|
|
let x: i32;
|
|
|
|
let _ = x + 1; //~ERROR (Ast) [E0381]
|
|
|
|
//~^ ERROR (Mir) [E0381]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
ok();
|
2017-11-27 02:06:36 -06:00
|
|
|
also_ok();
|
2017-11-10 05:11:25 -06:00
|
|
|
fail();
|
|
|
|
}
|