mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 09:13:07 +03:00
decrease false negatives for str overflow test
This commit is contained in:
@@ -602,7 +602,9 @@ mod overflow {
|
||||
mod rangeinclusive {
|
||||
let DATA = "hello";
|
||||
|
||||
let BAD_INPUT = 1..=usize::max_value();
|
||||
// note: using 0 specifically ensures that the result of overflowing is 0..0,
|
||||
// so that `get` doesn't simply return None for the wrong reason.
|
||||
let BAD_INPUT = 0..=usize::max_value();
|
||||
const EXPECT_MSG = "maximum usize";
|
||||
|
||||
!!generate_tests!!
|
||||
|
||||
Reference in New Issue
Block a user