From d9b9f4ee7de2b5a05547085382a7fc6e196f7c0d Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Wed, 13 May 2015 21:58:26 +0300 Subject: fix conflicts --- src/liballoc/rc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 88c5c38172a..b8d8e6ad0a1 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -543,7 +543,7 @@ impl Drop for Rc { unsafe { let ptr = *self._ptr; if !(*(&ptr as *const _ as *const *const ())).is_null() && - ptr as usize != mem::POST_DROP_USIZE { + ptr as *const () as usize != mem::POST_DROP_USIZE { self.dec_strong(); if self.strong() == 0 { // destroy the contained object @@ -1051,7 +1051,7 @@ impl Drop for Weak { unsafe { let ptr = *self._ptr; if !(*(&ptr as *const _ as *const *const ())).is_null() && - ptr as usize != mem::POST_DROP_USIZE { + ptr as *const () as usize != mem::POST_DROP_USIZE { self.dec_weak(); // the weak count starts at 1, and will only go to zero if all // the strong pointers have disappeared. -- cgit 1.4.1-3-g733a5 From e7e1fd20deb95f74c4a33c76921907e039dff894 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Tue, 19 May 2015 22:54:44 +0300 Subject: Fix rebase conflicts --- src/liballoc/arc.rs | 8 ++++++-- src/librustc_lint/builtin.rs | 2 +- src/librustc_trans/trans/expr.rs | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index ff942444a61..97e85b114b0 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -394,7 +394,9 @@ impl Drop for Arc { // it's run more than once) let ptr = *self._ptr; // if ptr.is_null() { return } - if ptr as usize == 0 || ptr as usize == mem::POST_DROP_USIZE { return } + if ptr as *mut u8 as usize == 0 || ptr as *mut u8 as usize == mem::POST_DROP_USIZE { + return + } // Because `fetch_sub` is already atomic, we do not need to synchronize // with other threads unless we are going to delete the object. This @@ -524,7 +526,9 @@ impl Drop for Weak { let ptr = *self._ptr; // see comments above for why this check is here - if ptr as usize == 0 || ptr as usize == mem::POST_DROP_USIZE { return } + if ptr as *mut u8 as usize == 0 || ptr as *mut u8 as usize == mem::POST_DROP_USIZE { + return + } // If we find out that we were the last weak pointer, then its time to // deallocate the data entirely. See the discussion in Arc::drop() about diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 8d555240e70..3716ee395bf 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -206,7 +206,7 @@ impl LintPass for TypeLimits { let (min, max) = int_ty_range(int_type); let negative = self.negated_expr_id == e.id; - if (negative && v > (min.abs() as u64)) || + if (negative && v > min.wrapping_neg() as u64) || (!negative && v > (max.abs() as u64)) { cx.span_lint(OVERFLOWING_LITERALS, e.span, &*format!("literal out of range for {:?}", t)); diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index 90741d1d58f..33eb3814087 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -2048,8 +2048,9 @@ fn trans_imm_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, } else { llsrc }; } - let _icx = push_ctxt("trans_cast"); let mut bcx = bcx; let ccx = - bcx.ccx(); + let _icx = push_ctxt("trans_cast"); + let mut bcx = bcx; + let ccx = bcx.ccx(); let t_in = expr_ty_adjusted(bcx, expr); let t_out = node_id_type(bcx, id); -- cgit 1.4.1-3-g733a5