提交 3b9848b8 编写于 作者: E Eric Holk

Remove some warnings and make tests pass.

上级 e4c29153
......@@ -28,7 +28,6 @@ fn rust_atomic_decrement(p: &mut libc::intptr_t)
unsafe {
let data: ~arc_data<T> = unsafe::reinterpret_cast(data);
let new_count = rustrt::rust_atomic_decrement(&mut data.count);
let data_ptr : *() = unsafe::reinterpret_cast(data);
assert new_count >= 0;
if new_count == 0 {
// drop glue takes over.
......@@ -70,7 +69,6 @@ fn clone<T: const>(rc: &arc<T>) -> arc<T> {
unsafe {
let ptr: ~arc_data<T> = unsafe::reinterpret_cast(**rc);
let new_count = rustrt::rust_atomic_increment(&mut ptr.count);
let data_ptr : *() = unsafe::reinterpret_cast(ptr);
assert new_count >= 2;
unsafe::forget(ptr);
}
......@@ -97,7 +95,6 @@ fn clone() -> exclusive<T> {
// this makes me nervous...
let ptr: ~arc_data<ex_data<T>> = unsafe::reinterpret_cast(*self);
let new_count = rustrt::rust_atomic_increment(&mut ptr.count);
let data_ptr : *() = unsafe::reinterpret_cast(ptr);
assert new_count > 1;
unsafe::forget(ptr);
}
......
......@@ -2193,13 +2193,6 @@ fn from_mut_no_copy() unsafe {
assert addr == addr_imm;
}
#[test]
fn test_unshift() {
let mut x = [1, 2, 3];
unshift(x, 0);
assert x == [0, 1, 2, 3];
}
#[test]
fn test_capacity() {
let mut v = [0u64];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册