diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-04-30 10:37:58 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-04-30 19:53:02 -0700 |
| commit | 2db4259b3531e0cfa1f6df2ff95e30a4c871a105 (patch) | |
| tree | 192b8d969e34bd1390bd769e17d68b2e9c57e77e /src/libcore | |
| parent | 079c3b02a86aa73d0d070876612ed889dc187354 (diff) | |
| download | rust-2db4259b3531e0cfa1f6df2ff95e30a4c871a105.tar.gz rust-2db4259b3531e0cfa1f6df2ff95e30a4c871a105.zip | |
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.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/priv.rs | 4 | ||||
| -rw-r--r-- | src/libcore/vec.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libcore/priv.rs b/src/libcore/priv.rs index 90fc9239e14..4aa8b57568f 100644 --- a/src/libcore/priv.rs +++ b/src/libcore/priv.rs @@ -14,7 +14,7 @@ native mod rustrt { fn rust_task_unweaken(ch: rust_port_id); } -type global_ptr<T: send> = *libc::uintptr_t; +type global_ptr = *libc::uintptr_t; #[doc = " Atomically gets a channel from a pointer to a pointer-sized memory location @@ -22,7 +22,7 @@ or, if no channel exists creates and installs a new channel and sets up a new task to receive from it. "] unsafe fn chan_from_global_ptr<T: send>( - global: global_ptr<T>, + global: global_ptr, builder: fn() -> task::builder, f: fn~(comm::port<T>) ) -> comm::chan<T> { diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index ad1c3f2344a..3215f3b9f28 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -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) } } |
