From 33688eaa1048c9d2a13e2d53f9e9ff9727f1de0b Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 17 Sep 2019 17:02:45 +0200 Subject: [PATCH] Remove the FIXME about the cache size checks And leave a NOTE. --- library/stdarch/crates/std_detect/src/detect/cache.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/library/stdarch/crates/std_detect/src/detect/cache.rs b/library/stdarch/crates/std_detect/src/detect/cache.rs index 1de4316b8f44..20f72b6fd46b 100644 --- a/library/stdarch/crates/std_detect/src/detect/cache.rs +++ b/library/stdarch/crates/std_detect/src/detect/cache.rs @@ -43,13 +43,13 @@ impl Default for Initializer { } } +// NOTE: the `debug_assert!` would catch that we do not add more Features than +// the one fitting our cache. impl Initializer { /// Tests the `bit` of the cache. #[allow(dead_code)] #[inline] pub(crate) fn test(self, bit: u32) -> bool { - // FIXME: this way of making sure that the cache is large enough is - // brittle. debug_assert!( bit < CACHE_CAPACITY, "too many features, time to increase the cache size!" @@ -60,8 +60,6 @@ impl Initializer { /// Sets the `bit` of the cache. #[inline] pub(crate) fn set(&mut self, bit: u32) { - // FIXME: this way of making sure that the cache is large enough is - // brittle. debug_assert!( bit < CACHE_CAPACITY, "too many features, time to increase the cache size!" @@ -73,8 +71,6 @@ impl Initializer { /// Unsets the `bit` of the cache. #[inline] pub(crate) fn unset(&mut self, bit: u32) { - // FIXME: this way of making sure that the cache is large enough is - // brittle. debug_assert!( bit < CACHE_CAPACITY, "too many features, time to increase the cache size!"