about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-09 22:17:42 +0000
committerbors <bors@rust-lang.org>2020-09-09 22:17:42 +0000
commit97eb606e4b2becd17d46a67d87169f52b210e67c (patch)
tree7a8f83e2ca64a5f2225f4476ef4a61de8e4e8a2d /library/alloc/src
parente2be5f568d1f60365b825530f5b5cb722460591b (diff)
parent32714eb6bc3cbfe48774e85472ad8431fba3c7c8 (diff)
downloadrust-97eb606e4b2becd17d46a67d87169f52b210e67c.tar.gz
rust-97eb606e4b2becd17d46a67d87169f52b210e67c.zip
Auto merge of #76540 - tmandry:rollup-5ogt8x0, r=tmandry
Rollup of 14 pull requests

Successful merges:

 - #75094 (Add `-Z combine_cgu` flag)
 - #75984 (Improve unresolved use error message)
 - #76141 (Address review comments about config.toml from rustc-dev-guide PR)
 - #76313 (Improved the MIR spanview output)
 - #76430 (Add align to rustc-attrs unstable book)
 - #76465 (Add a script to automatically update Rust/Clang versions in documentation)
 - #76473 (Add missed spaces to GCC-WARNING.txt)
 - #76481 (Convert repetitive target_pointer_width checks to const solution.)
 - #76493 (Remove a stray ignore-tidy-undocumented-unsafe)
 - #76504 (Capitalize safety comments)
 - #76515 (SessionDiagnostic: Fix non-determinism in generated format string.)
 - #76516 (Enable GitHub Releases synchronization)
 - #76522 (remove redundant clones)
 - #76523 (Remove unused PlaceContext::NonUse(NonUseContext::Coverage))

Failed merges:

r? `@ghost`
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/alloc.rs2
-rw-r--r--library/alloc/src/collections/vec_deque.rs10
2 files changed, 4 insertions, 8 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index 5f09f8def4d..341c6816197 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -157,7 +157,7 @@ impl Global {
         }
     }
 
-    // Safety: Same as `AllocRef::grow`
+    // SAFETY: Same as `AllocRef::grow`
     #[inline]
     unsafe fn grow_impl(
         &mut self,
diff --git a/library/alloc/src/collections/vec_deque.rs b/library/alloc/src/collections/vec_deque.rs
index cc2ef25a5a7..253a3e9f2be 100644
--- a/library/alloc/src/collections/vec_deque.rs
+++ b/library/alloc/src/collections/vec_deque.rs
@@ -32,12 +32,8 @@ mod tests;
 
 const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
 const MINIMUM_CAPACITY: usize = 1; // 2 - 1
-#[cfg(target_pointer_width = "16")]
-const MAXIMUM_ZST_CAPACITY: usize = 1 << (16 - 1); // Largest possible power of two
-#[cfg(target_pointer_width = "32")]
-const MAXIMUM_ZST_CAPACITY: usize = 1 << (32 - 1); // Largest possible power of two
-#[cfg(target_pointer_width = "64")]
-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
 
 /// A double-ended queue implemented with a growable ring buffer.
 ///
@@ -2392,7 +2388,7 @@ impl<T> VecDeque<T> {
         }
     }
 
-    // Safety: the following two methods require that the rotation amount
+    // SAFETY: the following two methods require that the rotation amount
     // be less than half the length of the deque.
     //
     // `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`,