Skip to content

Commit

Permalink
Use associated constants directly on primitive types instead of modules
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Apr 6, 2020
1 parent 6e07d2d commit c428c0e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Output};
use std::str;
use std::time::{self, Duration};
use std::usize;

use cargo::util::{is_ci, CargoResult, ProcessBuilder, ProcessError, Rustc};
use serde_json::{self, Value};
Expand Down
2 changes: 1 addition & 1 deletion crates/resolver-tests/tests/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ proptest! {
0
} else {
// but that local builds will give a small clear test case.
std::u32::MAX
u32::MAX
},
result_cache: prop::test_runner::basic_result_cache,
.. ProptestConfig::default()
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/resolver/conflict_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl ConflictCache {
dep: &Dependency,
must_contain: Option<PackageId>,
) -> Option<&ConflictMap> {
let out = self.find(dep, &|id| cx.is_active(id), must_contain, std::usize::MAX);
let out = self.find(dep, &|id| cx.is_active(id), must_contain, usize::MAX);
if cfg!(debug_assertions) {
if let Some(c) = &out {
assert!(cx.is_conflicting(None, c).is_some());
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/standard_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ fn lib_nostd() {
r#"
#![no_std]
pub fn foo() {
assert_eq!(core::u8::MIN, 0);
assert_eq!(u8::MIN, 0);
}
"#,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn cargo_test_overflow_checks() {
use std::panic;
pub fn main() {
let r = panic::catch_unwind(|| {
[1, i32::max_value()].iter().sum::<i32>();
[1, i32::MAX].iter().sum::<i32>();
});
assert!(r.is_err());
}"#,
Expand Down

0 comments on commit c428c0e

Please sign in to comment.