From 8ac3b46cac46e88ee2025ca9c9c0b853fd632110 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Mon, 6 Jun 2016 00:20:15 +0300 Subject: [PATCH] address review comments --- src/librustc_trans/mir/lvalue.rs | 2 +- src/libstd/sys/common/wtf8.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_trans/mir/lvalue.rs b/src/librustc_trans/mir/lvalue.rs index 0c7eeafe86e..523dfef5a24 100644 --- a/src/librustc_trans/mir/lvalue.rs +++ b/src/librustc_trans/mir/lvalue.rs @@ -199,7 +199,7 @@ pub fn trans_lvalue(&mut self, let base_ty = self.lvalue_ty(lvalue); let llbasety = type_of::type_of(bcx.ccx(), base_ty).ptr_to(); let llbase = bcx.pointercast(llbase, llbasety); - (bcx.pointercast(llbase, llbasety), ptr::null_mut()) + (llbase, ptr::null_mut()) } ty::TySlice(..) => { assert!(tr_base.llextra != ptr::null_mut()); diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 5519230890c..35e39531448 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -568,7 +568,7 @@ fn final_lead_surrogate(&self) -> Option { return None } if self.bytes[len-3] == 0xed && - self.bytes[len-2] > 0xa0 && + self.bytes[len-2] >= 0xa0 && self.bytes[len-2] <= 0xaf { Some(decode_surrogate(self.bytes[len-2], self.bytes[len-1])) @@ -583,11 +583,11 @@ fn initial_trail_surrogate(&self) -> Option { if len < 3 { return None } - if self.bytes[len-3] == 0xed && - self.bytes[len-2] > 0xb0 && - self.bytes[len-2] <= 0xbf + if self.bytes[0] == 0xed && + self.bytes[1] >= 0xb0 && + self.bytes[1] <= 0xbf { - Some(decode_surrogate(self.bytes[len-2], self.bytes[len-1])) + Some(decode_surrogate(self.bytes[1], self.bytes[2])) } else { None }