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

@@ -1168,7 +1168,9 @@ mod unsafe {
#[inline(always)]
unsafe fn form_slice<T,U>(p: *T, len: uint, f: fn([T]/&) -> U) -> U {
let pair = (p, len * sys::size_of::<T>());
let v : *([T]/&) = ::unsafe::reinterpret_cast(ptr::addr_of(pair));
// FIXME: should use &blk not &static here, but a snapshot is req'd
let v : *([T]/&static) =
::unsafe::reinterpret_cast(ptr::addr_of(pair));
f(*v)
}
}