add StorageDead handling

This commit is contained in:
Mikhail Modin 2017-11-10 14:11:25 +03:00
parent f93a4928c2
commit 830d65c1ff
4 changed files with 59 additions and 15 deletions

View file

@ -0,0 +1,30 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z emit-end-regions -Z borrowck-mir
fn ok() {
loop {
let _x = 1;
}
}
fn fail() {
loop {
let x: i32;
let _ = x + 1; //~ERROR (Ast) [E0381]
//~^ ERROR (Mir) [E0381]
}
}
fn main() {
ok();
fail();
}