Skip to content

Commit a3b235d

Browse files
committed
Use MAX associated constant
``` warning: use of constant `std::isize::MAX` that will be deprecated in a future Rust version: replaced by the `MAX` associated constant on this type --> src/utils.rs:100:68 | 100 | if !new_align.is_power_of_two() || new_size > core::isize::MAX as usize - (new_align - 1) { | ^^^ | = note: requested on the command line with `-W deprecated-in-future` warning: use of associated function `core::num::<impl isize>::max_value` that will be deprecated in a future Rust version: replaced by the `MAX` associated constant on this type --> src/raw.rs:313:47 | 313 | ... if state > isize::max_value() as usize { | ^^^^^^^^^ warning: use of associated function `core::num::<impl isize>::max_value` that will be deprecated in a future Rust version: replaced by the `MAX` associated constant on this type --> src/raw.rs:343:27 | 343 | if state > isize::max_value() as usize { | ```
1 parent cfaee09 commit a3b235d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/raw.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ where
310310
// If the task is not running, now is the time to schedule.
311311
if state & RUNNING == 0 {
312312
// If the reference count overflowed, abort.
313-
if state > isize::max_value() as usize {
313+
if state > isize::MAX as usize {
314314
abort();
315315
}
316316

@@ -340,7 +340,7 @@ where
340340
let state = (*raw.header).state.fetch_add(REFERENCE, Ordering::Relaxed);
341341

342342
// If the reference count overflowed, abort.
343-
if state > isize::max_value() as usize {
343+
if state > isize::MAX as usize {
344344
abort();
345345
}
346346

src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Layout {
9797
// - align is 0 (implied false by is_power_of_two())
9898
// - align is not a power of 2
9999
// - size rounded up to align overflows
100-
if !new_align.is_power_of_two() || new_size > core::isize::MAX as usize - (new_align - 1) {
100+
if !new_align.is_power_of_two() || new_size > isize::MAX as usize - (new_align - 1) {
101101
return None;
102102
}
103103

0 commit comments

Comments
 (0)