diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-09-27 14:50:55 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-09-27 16:03:10 -0700 |
| commit | b8bb663df787511c6b91bf3182b59d140a9c8e02 (patch) | |
| tree | 157792f952836504216eb4ba2715327a7afd361a /src/lib | |
| parent | e50580aa669efc91e5d374e4357bd48dd594169d (diff) | |
| download | rust-b8bb663df787511c6b91bf3182b59d140a9c8e02.tar.gz rust-b8bb663df787511c6b91bf3182b59d140a9c8e02.zip | |
Don't ever raise unique kinds of pinned kinds to shared (again)
So *resource, ~resource, [resource] are all pinned. This is counter to the design of the kind system, but this way is a much clearer path to type safety. Once we've established a good baseline with lots of tests, then we can try to make raising pinned kinds work.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ptr.rs | 6 | ||||
| -rw-r--r-- | src/lib/vec.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/ptr.rs b/src/lib/ptr.rs index 8d730732c3c..ccb05f0ce29 100644 --- a/src/lib/ptr.rs +++ b/src/lib/ptr.rs @@ -5,9 +5,9 @@ native "rust-intrinsic" mod rusti { fn ptr_offset<T>(ptr: *T, count: uint) -> *T; } -fn addr_of<T>(val: T) -> *mutable T { ret rusti::addr_of(val); } -fn offset<T>(ptr: *T, count: uint) -> *T { +fn addr_of<@T>(val: T) -> *mutable T { ret rusti::addr_of(val); } +fn offset<@T>(ptr: *T, count: uint) -> *T { ret rusti::ptr_offset(ptr, count); } -fn null<T>() -> *T { ret unsafe::reinterpret_cast(0u); } +fn null<@T>() -> *T { ret unsafe::reinterpret_cast(0u); } diff --git a/src/lib/vec.rs b/src/lib/vec.rs index 9b0e2a63091..3bb03afb483 100644 --- a/src/lib/vec.rs +++ b/src/lib/vec.rs @@ -345,18 +345,18 @@ mod unsafe { ret rustrt::vec_from_buf_shared(ptr, elts); } - fn set_len<T>(&v: [T], new_len: uint) { + fn set_len<@T>(&v: [T], new_len: uint) { let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v)); (**repr).fill = new_len * sys::size_of::<T>(); } - fn to_ptr<T>(v: [T]) -> *T { + fn to_ptr<@T>(v: [T]) -> *T { let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v)); ret ::unsafe::reinterpret_cast(addr_of((**repr).data)); } } -fn to_ptr<T>(v: [T]) -> *T { ret unsafe::to_ptr(v); } +fn to_ptr<@T>(v: [T]) -> *T { ret unsafe::to_ptr(v); } // Local Variables: // mode: rust; |
