Skip to content

Commit dba6678

Browse files
replace MIN/MAX constants with min_value/max_value functions
MIN and MAX were breaking the build for me. min_value and max_value do not.
1 parent a802ec1 commit dba6678

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/test/run-fail/iter-step-overflow-debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ use std::panic;
1414

1515
fn main() {
1616
let r = panic::catch_unwind(|| {
17-
let mut it = u8::MAX..;
17+
let mut it = u8::max_value()..;
1818
it.next();
1919
});
2020
assert!(r.is_err());
2121

2222
let r = panic::catch_unwind(|| {
23-
let mut it = i8::MAX..;
23+
let mut it = i8::max_value()..;
2424
it.next();
2525
});
2626
assert!(r.is_err());

src/test/run-fail/iter-step-overflow-ndebug.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// compile-flags: -C debug_assertions=no
1212

1313
fn main() {
14-
let mut it = u8::MAX..;
15-
assert_eq!(it.next(), u8::MIN);
14+
let mut it = u8::max_value()..;
15+
assert_eq!(it.next(), u8::min_value());
1616

17-
let mut it = i8::MAX..;
18-
assert_eq!(it.next(), i8::MIN);
17+
let mut it = i8::max_value()..;
18+
assert_eq!(it.next(), i8::min_value());
1919
}

0 commit comments

Comments
 (0)