diff options
| author | bors <bors@rust-lang.org> | 2014-01-07 01:51:39 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-07 01:51:39 -0800 |
| commit | bc395bc71e02a7726565725ce026758f948b2d76 (patch) | |
| tree | 86576b45e6b489f635fdca29bc4687c7ebd3be96 /src/libstd | |
| parent | 777f1e8d24a5816a7ca1308ef4243201a6b81221 (diff) | |
| parent | 82365501043735dd8ec5eadaa5d30354cee19252 (diff) | |
| download | rust-bc395bc71e02a7726565725ce026758f948b2d76.tar.gz rust-bc395bc71e02a7726565725ce026758f948b2d76.zip | |
auto merge of #11329 : fhahn/rust/unused-cast-lint2, r=alexcrichton
Updates as mentioned in #11135
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/cleanup.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 10 | ||||
| -rw-r--r-- | src/libstd/io/net/ip.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 2 | ||||
| -rw-r--r-- | src/libstd/num/strconv.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rand/distributions/normal.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/global_heap.rs | 2 | ||||
| -rw-r--r-- | src/libstd/str.rs | 4 | ||||
| -rw-r--r-- | src/libstd/unstable/mutex.rs | 4 |
9 files changed, 17 insertions, 17 deletions
diff --git a/src/libstd/cleanup.rs b/src/libstd/cleanup.rs index fbcf7dd4e90..fd9040423a3 100644 --- a/src/libstd/cleanup.rs +++ b/src/libstd/cleanup.rs @@ -42,7 +42,7 @@ unsafe fn each_live_alloc(read_next_before: bool, let next_before = (*alloc).next; let uniq = (*alloc).ref_count == managed::RC_MANAGED_UNIQUE; - if !f(alloc as *mut raw::Box<()>, uniq) { + if !f(alloc, uniq) { return false; } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index b7e185f8ed5..823ca80a8a1 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -725,7 +725,7 @@ pub trait Reader { /// /// `u64`s are 8 bytes long. fn read_be_u64(&mut self) -> u64 { - self.read_be_uint_n(8) as u64 + self.read_be_uint_n(8) } /// Reads a big-endian `u32`. @@ -746,7 +746,7 @@ pub trait Reader { /// /// `i64`s are 8 bytes long. fn read_be_i64(&mut self) -> i64 { - self.read_be_int_n(8) as i64 + self.read_be_int_n(8) } /// Reads a big-endian `i32`. @@ -785,7 +785,7 @@ pub trait Reader { /// /// `u64`s are 8 bytes long. fn read_le_u64(&mut self) -> u64 { - self.read_le_uint_n(8) as u64 + self.read_le_uint_n(8) } /// Reads a little-endian `u32`. @@ -806,7 +806,7 @@ pub trait Reader { /// /// `i64`s are 8 bytes long. fn read_le_i64(&mut self) -> i64 { - self.read_le_int_n(8) as i64 + self.read_le_int_n(8) } /// Reads a little-endian `i32`. @@ -846,7 +846,7 @@ pub trait Reader { /// `u8`s are 1 byte. fn read_u8(&mut self) -> u8 { match self.read_byte() { - Some(b) => b as u8, + Some(b) => b, None => 0 } } diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index b4d14b57efc..9fd183ca770 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -153,11 +153,11 @@ impl<'a> Parser<'a> { let c = c as u8; // assuming radix is either 10 or 16 if c >= '0' as u8 && c <= '9' as u8 { - Some((c - '0' as u8) as u8) + Some(c - '0' as u8) } else if radix > 10 && c >= 'a' as u8 && c < 'a' as u8 + (radix - 10) { - Some((c - 'a' as u8 + 10) as u8) + Some(c - 'a' as u8 + 10) } else if radix > 10 && c >= 'A' as u8 && c < 'A' as u8 + (radix - 10) { - Some((c - 'A' as u8 + 10) as u8) + Some(c - 'A' as u8 + 10) } else { None } diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 1e4fa7968dc..1fcafd7d12f 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -209,7 +209,7 @@ impl Reader for StdReader { io_error::cond.raise(standard_error(EndOfFile)); None } - Ok(amt) => Some(amt as uint), + Ok(amt) => Some(amt), Err(e) => { io_error::cond.raise(e); None diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 8e678ab66b2..7dcae69f70d 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -344,7 +344,7 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+ // round the remaining ones. if limit_digits && dig == digit_count { let ascii2value = |chr: u8| { - char::to_digit(chr as char, radix).unwrap() as uint + char::to_digit(chr as char, radix).unwrap() }; let value2ascii = |val: uint| { char::from_digit(val, radix).unwrap() as u8 diff --git a/src/libstd/rand/distributions/normal.rs b/src/libstd/rand/distributions/normal.rs index 4103b859ff8..8dc9372aec9 100644 --- a/src/libstd/rand/distributions/normal.rs +++ b/src/libstd/rand/distributions/normal.rs @@ -32,7 +32,7 @@ impl Rand for StandardNormal { fn rand<R:Rng>(rng: &mut R) -> StandardNormal { #[inline] fn pdf(x: f64) -> f64 { - ((-x*x/2.0) as f64).exp() + (-x*x/2.0).exp() } #[inline] fn zero_case<R:Rng>(rng: &mut R, u: f64) -> f64 { diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 385bb0b276c..c094344f6b9 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -76,7 +76,7 @@ pub unsafe fn closure_exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char { assert!(td.is_not_null()); let total_size = get_box_size(size, (*td).align); - let p = malloc_raw(total_size as uint); + let p = malloc_raw(total_size); let alloc = p as *mut raw::Box<()>; (*alloc).type_desc = td; diff --git a/src/libstd/str.rs b/src/libstd/str.rs index 4d3fa5d65fd..230564c6bf1 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -901,7 +901,7 @@ pub fn utf16_chars(v: &[u16], f: |char|) { let mut c: u32 = (u - 0xD800_u16) as u32; c = c << 10; c |= (u2 - 0xDC00_u16) as u32; - c |= 0x1_0000_u32 as u32; + c |= 0x1_0000_u32; f(unsafe { cast::transmute(c) }); i += 2u; } @@ -987,7 +987,7 @@ pub mod raw { /// Create a Rust string from a *u8 buffer of the given length pub unsafe fn from_buf_len(buf: *u8, len: uint) -> ~str { let mut v: ~[u8] = vec::with_capacity(len); - ptr::copy_memory(v.as_mut_ptr(), buf as *u8, len); + ptr::copy_memory(v.as_mut_ptr(), buf, len); v.set_len(len); assert!(is_utf8(v)); diff --git a/src/libstd/unstable/mutex.rs b/src/libstd/unstable/mutex.rs index 36682b85418..e11557ff337 100644 --- a/src/libstd/unstable/mutex.rs +++ b/src/libstd/unstable/mutex.rs @@ -66,8 +66,8 @@ impl Mutex { /// Creates a new mutex, with the lock/condition variable pre-initialized pub unsafe fn new() -> Mutex { Mutex { - lock: atomics::AtomicUint::new(imp::init_lock() as uint), - cond: atomics::AtomicUint::new(imp::init_cond() as uint), + lock: atomics::AtomicUint::new(imp::init_lock()), + cond: atomics::AtomicUint::new(imp::init_cond()), } } |
