Rollup merge of #22504 - GuillaumeGomez:audit-integer-libcore, r=Manishearth

Part of #22240.
This commit is contained in:
Manish Goregaokar 2015-03-02 03:53:41 +05:30
commit fb19cd7fb7
17 changed files with 53 additions and 122 deletions

View file

@ -1,11 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
int_module!(int, int);

View file

@ -12,7 +12,7 @@ macro_rules! int_module { ($T:ty, $T_i:ident) => (
#[cfg(test)]
mod tests {
use core::$T_i::*;
use core::int;
use core::isize;
use core::num::{FromStrRadix, Int, SignedInt};
use core::ops::{Shl, Shr, Not, BitXor, BitAnd, BitOr};
use num;
@ -153,7 +153,7 @@ mod tests {
fn test_signed_checked_div() {
assert!(10.checked_div(2) == Some(5));
assert!(5.checked_div(0) == None);
assert!(int::MIN.checked_div(-1) == None);
assert!(isize::MIN.checked_div(-1) == None);
}
#[test]

View file

@ -21,7 +21,6 @@ mod i8;
mod i16;
mod i32;
mod i64;
mod int;
#[macro_use]
mod uint_macros;
@ -30,7 +29,6 @@ mod u8;
mod u16;
mod u32;
mod u64;
mod uint;
/// Helper function for testing numeric operations
pub fn test_num<T>(ten: T, two: T) where

View file

@ -1,11 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
uint_module!(uint, uint);