diff --git a/src/lib.rs b/src/lib.rs index 353bb23..d6aad6e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -988,6 +988,7 @@ impl SmallVec { // In our case, this also ensures that a smallvec of zero-size items // never spills, and we never try to allocate zero bytes // which `std::alloc::alloc` disallows. + #[allow(deprecated)] core::usize::MAX } } @@ -1490,8 +1491,10 @@ impl SmallVec { } let (lower_size_bound, _) = iter.size_hint(); - assert!(lower_size_bound <= core::isize::MAX as usize); // Ensure offset - // is indexable + #[allow(deprecated)] + { + assert!(lower_size_bound <= core::isize::MAX as usize) + } // Ensure offset is indexable assert!(index + lower_size_bound >= index); // Protect against overflow let mut num_added = 0; diff --git a/src/tests.rs b/src/tests.rs index e12ba9f..e0118cc 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -434,6 +434,7 @@ fn test_invalid_grow() { #[should_panic] fn drain_overflow() { let mut v: SmallVec<[u8; 8]> = smallvec![0]; + #[allow(deprecated)] v.drain(..=std::usize::MAX); }