about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-09 09:43:55 +0000
committerbors <bors@rust-lang.org>2021-03-09 09:43:55 +0000
commit3a5d45f68cadc8fff4fbb557780f92b403b19c19 (patch)
tree2d80555f16636c76ee9e5d452078c13f19cc1f4a /library
parent4b9f5cc4c10a161047475cb9bbe02c4fda57fb07 (diff)
parent74de9db0ce515a26171c441cd808e6d872010f86 (diff)
downloadrust-3a5d45f68cadc8fff4fbb557780f92b403b19c19.tar.gz
rust-3a5d45f68cadc8fff4fbb557780f92b403b19c19.zip
Auto merge of #82929 - m-ou-se:rollup-7fwrewh, r=m-ou-se
Rollup of 8 pull requests

Successful merges:

 - #81127 (Improve sift_down performance in BinaryHeap)
 - #81879 (Added #[repr(transparent)] to core::cmp::Reverse)
 - #82048 (or-patterns: disallow in `let` bindings)
 - #82731 (Bump libc dependency of std to 0.2.88.)
 - #82799 (Add regression test for #75525)
 - #82841 (Change x64 size checks to not apply to x32.)
 - #82883 (Update Cargo)
 - #82887 (Update CONTRIBUTING.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library')
-rw-r--r--library/alloc/src/collections/binary_heap.rs4
-rw-r--r--library/core/src/cmp.rs1
-rw-r--r--library/std/Cargo.toml2
3 files changed, 4 insertions, 3 deletions
diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs
index 4377780e15f..b5e66d37ab4 100644
--- a/library/alloc/src/collections/binary_heap.rs
+++ b/library/alloc/src/collections/binary_heap.rs
@@ -566,7 +566,7 @@ impl<T: Ord> BinaryHeap<T> {
         let mut child = 2 * hole.pos() + 1;
 
         // Loop invariant: child == 2 * hole.pos() + 1.
-        while child < end - 1 {
+        while child <= end.saturating_sub(2) {
             // compare with the greater of the two children
             // SAFETY: child < end - 1 < self.len() and
             //  child + 1 < end <= self.len(), so they're valid indexes.
@@ -625,7 +625,7 @@ impl<T: Ord> BinaryHeap<T> {
         let mut child = 2 * hole.pos() + 1;
 
         // Loop invariant: child == 2 * hole.pos() + 1.
-        while child < end - 1 {
+        while child <= end.saturating_sub(2) {
             // SAFETY: child < end - 1 < self.len() and
             //  child + 1 < end <= self.len(), so they're valid indexes.
             //  child == 2 * hole.pos() + 1 != hole.pos() and
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs
index 4a15b185a83..5bab1fb93db 100644
--- a/library/core/src/cmp.rs
+++ b/library/core/src/cmp.rs
@@ -579,6 +579,7 @@ impl Ordering {
 /// ```
 #[derive(PartialEq, Eq, Debug, Copy, Clone, Default, Hash)]
 #[stable(feature = "reverse_cmp_key", since = "1.19.0")]
+#[repr(transparent)]
 pub struct Reverse<T>(#[stable(feature = "reverse_cmp_key", since = "1.19.0")] pub T);
 
 #[stable(feature = "reverse_cmp_key", since = "1.19.0")]
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
index 275fcc4c292..f0f5558fd16 100644
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -16,7 +16,7 @@ cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
 panic_unwind = { path = "../panic_unwind", optional = true }
 panic_abort = { path = "../panic_abort" }
 core = { path = "../core" }
-libc = { version = "0.2.85", default-features = false, features = ['rustc-dep-of-std'] }
+libc = { version = "0.2.88", default-features = false, features = ['rustc-dep-of-std'] }
 compiler_builtins = { version = "0.1.39" }
 profiler_builtins = { path = "../profiler_builtins", optional = true }
 unwind = { path = "../unwind" }