Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/dep_graph/serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use std::cell::RefCell;
use std::cmp::max;
use std::sync::Arc;
use std::sync::atomic::Ordering;
use std::{iter, mem, u64};
use std::{iter, mem};

use rustc_data_structures::fingerprint::{Fingerprint, PackedFingerprint};
use rustc_data_structures::fx::FxHashMap;
Expand Down
2 changes: 1 addition & 1 deletion library/coretests/tests/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ fn array_mixed_equality_integers() {

#[test]
fn array_mixed_equality_nans() {
let array3: [f32; 3] = [1.0, std::f32::NAN, 3.0];
let array3: [f32; 3] = [1.0, f32::NAN, 3.0];

let slice3: &[f32] = &{ array3 };
assert!(!(array3 == slice3));
Expand Down
3 changes: 2 additions & 1 deletion library/coretests/tests/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ macro_rules! int_module {
($T:ident, $U:ident) => {
use core::num::ParseIntError;
use core::ops::{BitAnd, BitOr, BitXor, Not, Shl, Shr};
use core::$T::*;
const MAX: $T = $T::MAX;
const MIN: $T = $T::MIN;

const UMAX: $U = $U::MAX;

Expand Down
15 changes: 7 additions & 8 deletions library/coretests/tests/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ macro_rules! uint_module {
($T:ident) => {
use core::num::ParseIntError;
use core::ops::{BitAnd, BitOr, BitXor, Not, Shl, Shr};
use core::$T::*;

use crate::num;

#[test]
fn test_overflows() {
assert!(MAX > 0);
assert!(MIN <= 0);
assert!((MIN + MAX).wrapping_add(1) == 0);
assert!($T::MAX > 0);
assert!($T::MIN <= 0);
assert!(($T::MIN + $T::MAX).wrapping_add(1) == 0);
}

#[test]
Expand All @@ -25,7 +24,7 @@ macro_rules! uint_module {
assert!(0b0110 as $T == (0b1100 as $T).bitxor(0b1010 as $T));
assert!(0b1110 as $T == (0b0111 as $T).shl(1));
assert!(0b0111 as $T == (0b1110 as $T).shr(1));
assert!(MAX - (0b1011 as $T) == (0b1011 as $T).not());
assert!($T::MAX - (0b1011 as $T) == (0b1011 as $T).not());
}

const A: $T = 0b0101100;
Expand Down Expand Up @@ -361,7 +360,7 @@ macro_rules! uint_module {
assert_eq_const_safe!($T: R.wrapping_pow(2), 1 as $T);
assert_eq_const_safe!(Option<$T>: R.checked_pow(2), None);
assert_eq_const_safe!(($T, bool): R.overflowing_pow(2), (1 as $T, true));
assert_eq_const_safe!($T: R.saturating_pow(2), MAX);
assert_eq_const_safe!($T: R.saturating_pow(2), $T::MAX);
}
}

Expand Down Expand Up @@ -468,14 +467,14 @@ macro_rules! uint_module {
fn test_next_multiple_of() {
assert_eq_const_safe!($T: (16 as $T).next_multiple_of(8), 16);
assert_eq_const_safe!($T: (23 as $T).next_multiple_of(8), 24);
assert_eq_const_safe!($T: MAX.next_multiple_of(1), MAX);
assert_eq_const_safe!($T: $T::MAX.next_multiple_of(1), $T::MAX);
}

fn test_checked_next_multiple_of() {
assert_eq_const_safe!(Option<$T>: (16 as $T).checked_next_multiple_of(8), Some(16));
assert_eq_const_safe!(Option<$T>: (23 as $T).checked_next_multiple_of(8), Some(24));
assert_eq_const_safe!(Option<$T>: (1 as $T).checked_next_multiple_of(0), None);
assert_eq_const_safe!(Option<$T>: MAX.checked_next_multiple_of(2), None);
assert_eq_const_safe!(Option<$T>: $T::MAX.checked_next_multiple_of(2), None);
}

fn test_is_next_multiple_of() {
Expand Down
1 change: 0 additions & 1 deletion library/stdarch/crates/core_arch/src/mips/msa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9187,7 +9187,6 @@ mod tests {
core_arch::{mips::msa::*, simd::*},
mem,
};
use std::{f32, f64};
use stdarch_test::simd_test;

#[simd_test(enable = "msa")]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/src/vertical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fn struct_field_prefix_max_min_width<T: AlignedItem>(
.rewrite_prefix(context, shape)
.map(|field_str| trimmed_last_line_width(&field_str))
})
.fold_ok((0, ::std::usize::MAX), |(max_len, min_len), len| {
.fold_ok((0, usize::MAX), |(max_len, min_len), len| {
(cmp::max(max_len, len), cmp::min(min_len, len))
})
.unwrap_or((0, 0))
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/issue-90762.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ fn main() {
for (i, b) in FOO.iter().enumerate() {
assert!(b.load(Ordering::Relaxed), "{} not set", i);
}
assert_eq!(BAR.fetch_add(1, Ordering::Relaxed), usize::max_value());
assert_eq!(BAR.fetch_add(1, Ordering::Relaxed), usize::MAX);
}
Loading