mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
decrease false negatives for str overflow test
This commit is contained in:
parent
ce66f5d918
commit
02b3da1200
@ -602,7 +602,9 @@ mod slice_index {
|
||||
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!!
|
||||
|
Loading…
Reference in New Issue
Block a user