Stop inferring bot/static when types/regions are unconstrained.

Also, some other changes that came up along the way:
- add a 'blk' region for the current block.
- detect unused type/region variables.
This commit is contained in:
Niko Matsakis 2012-04-30 10:37:58 -07:00
parent 079c3b02a8
commit 2db4259b35
30 changed files with 234 additions and 154 deletions

View file

@ -1,57 +0,0 @@
// xfail-pretty
fn id(x: bool) -> bool { x }
fn call_id() {
let c <- fail;
id(c);
}
fn call_id_2() { id(true) && id(ret); }
fn call_id_4() { while id(ret) { } }
fn bind_id_1() { bind id(fail); }
fn bind_id_2() { bind id(ret); }
fn fail_fail() { fail fail; }
fn log_fail() { log(error, fail); }
fn log_ret() { log(error, ret); }
fn log_break() { loop { log(error, break); } }
fn log_cont() { do { log(error, cont); } while false }
fn ret_ret() -> int { ret 3 + (ret 2); }
fn ret_guard() {
alt check 2 {
x if (ret) { x; }
}
}
fn rec_ret() { let _r: {c: int} = {c: ret}; }
fn vec_ret() { let _v: [int] = [1, 2, ret, 4]; }
fn fail_then_concat() {
let mut x = [], y = [3];
fail;
x += y;
"good" + "bye";
}
fn main() {
// Call the functions that don't fail.
rec_ret();
vec_ret();
ret_ret();
log_ret();
call_id_2();
call_id_4();
bind_id_2();
ret_guard();
}