Remove cfg(test) from library/core
This commit is contained in:
parent
1a94d839be
commit
4f3ef2ac90
5 changed files with 697 additions and 707 deletions
|
@ -1,9 +1,6 @@
|
|||
#![doc = include_str!("error.md")]
|
||||
#![stable(feature = "error_in_core", since = "1.81.0")]
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use crate::any::TypeId;
|
||||
use crate::fmt::{Debug, Display, Formatter, Result};
|
||||
|
||||
|
|
|
@ -141,7 +141,6 @@ mod intrinsics;
|
|||
mod io;
|
||||
mod iter;
|
||||
mod lazy;
|
||||
#[cfg(test)]
|
||||
mod macros;
|
||||
mod manually_drop;
|
||||
mod mem;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
macro_rules! int_module {
|
||||
($T:ident) => {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use core::ops::{BitAnd, BitOr, BitXor, Not, Shl, Shr};
|
||||
use core::$T::*;
|
||||
|
||||
|
@ -422,6 +420,5 @@ macro_rules! int_module {
|
|||
assert_eq!(<$T>::midpoint(<$T>::MAX, 6), <$T>::MAX / 2 + 3);
|
||||
assert_eq!(<$T>::midpoint(6, <$T>::MAX), <$T>::MAX / 2 + 3);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ fn test_can_not_overflow() {
|
|||
|
||||
// Check u128 separately:
|
||||
for base in 2..=36 {
|
||||
let num = u128::MAX as u128;
|
||||
let num = <u128>::MAX;
|
||||
let max_len_string = format_radix(num, base as u128);
|
||||
// base 16 fits perfectly for u128 and won't overflow:
|
||||
assert_eq!(can_overflow::<u128>(base, &max_len_string), base != 16);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
macro_rules! uint_module {
|
||||
($T:ident) => {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use core::ops::{BitAnd, BitOr, BitXor, Not, Shl, Shr};
|
||||
use core::$T::*;
|
||||
use std::str::FromStr;
|
||||
|
@ -315,6 +313,5 @@ macro_rules! uint_module {
|
|||
assert_eq!(<$T>::midpoint(<$T>::MAX, 6), (<$T>::MAX - <$T>::MIN) / 2 + 3);
|
||||
assert_eq!(<$T>::midpoint(6, <$T>::MAX), (<$T>::MAX - <$T>::MIN) / 2 + 3);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue