We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 09bfb7e + e02952c commit 0d20cf8Copy full SHA for 0d20cf8
library/alloc/src/collections/vec_deque.rs
@@ -32,12 +32,8 @@ mod tests;
32
33
const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
34
const MINIMUM_CAPACITY: usize = 1; // 2 - 1
35
-#[cfg(target_pointer_width = "16")]
36
-const MAXIMUM_ZST_CAPACITY: usize = 1 << (16 - 1); // Largest possible power of two
37
-#[cfg(target_pointer_width = "32")]
38
-const MAXIMUM_ZST_CAPACITY: usize = 1 << (32 - 1); // Largest possible power of two
39
-#[cfg(target_pointer_width = "64")]
40
-const MAXIMUM_ZST_CAPACITY: usize = 1 << (64 - 1); // Largest possible power of two
+
+const MAXIMUM_ZST_CAPACITY: usize = 1 << (core::mem::size_of::<usize>() * 8 - 1); // Largest possible power of two
41
42
/// A double-ended queue implemented with a growable ring buffer.
43
///
0 commit comments