Rollup merge of #22504 - GuillaumeGomez:audit-integer-libcore, r=Manishearth
Part of #22240.
This commit is contained in:
commit
fb19cd7fb7
17 changed files with 53 additions and 122 deletions
|
|
@ -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);
|
||||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue