diff options
| author | bors <bors@rust-lang.org> | 2020-11-01 11:54:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-01 11:54:58 +0000 |
| commit | e8cbaf2ae7fc5c564cacedbe55664797dc62d920 (patch) | |
| tree | 8dc4198dbba092145d4bf6e5a4b9ecd4a01534f8 /library/alloc | |
| parent | 1e37ba76d47280fa867c3863aa6d22376535637a (diff) | |
| parent | 97678b8358bf9e1d0b81f1e0e15f223f7a571d68 (diff) | |
| download | rust-e8cbaf2ae7fc5c564cacedbe55664797dc62d920.tar.gz rust-e8cbaf2ae7fc5c564cacedbe55664797dc62d920.zip | |
Auto merge of #78623 - m-ou-se:rollup-m6y5j0m, r=m-ou-se
Rollup of 6 pull requests Successful merges: - #78073 (Add #[inline] to some functions in core::str.) - #78596 (Fix doc links to std::fmt) - #78599 (Add note to process::arg[s] that args shouldn't be escaped or quoted) - #78602 (fix various aliasing issues in the standard library) - #78603 (expand: Tweak a comment in implementation of `macro_rules`) - #78621 (Inline Default::default() for atomics) Failed merges: r? `@ghost`
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/collections/binary_heap.rs | 5 | ||||
| -rw-r--r-- | library/alloc/src/macros.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index f2852b1cc2b..b67c72d7136 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -1036,8 +1036,9 @@ impl<'a, T> Hole<'a, T> { debug_assert!(index != self.pos); debug_assert!(index < self.data.len()); unsafe { - let index_ptr: *const _ = self.data.get_unchecked(index); - let hole_ptr = self.data.get_unchecked_mut(self.pos); + let ptr = self.data.as_mut_ptr(); + let index_ptr: *const _ = ptr.add(index); + let hole_ptr = ptr.add(self.pos); ptr::copy_nonoverlapping(index_ptr, hole_ptr, 1); } self.pos = index; diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index 2f744618d69..a992d768d63 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -71,7 +71,7 @@ macro_rules! vec { /// /// Additional parameters passed to `format!` replace the `{}`s within the /// formatting string in the order given unless named or positional parameters -/// are used; see [`std::fmt`][fmt] for more information. +/// are used; see [`std::fmt`] for more information. /// /// A common use for `format!` is concatenation and interpolation of strings. /// The same convention is used with [`print!`] and [`write!`] macros, @@ -80,7 +80,7 @@ macro_rules! vec { /// To convert a single value to a string, use the [`to_string`] method. This /// will use the [`Display`] formatting trait. /// -/// [fmt]: core::fmt +/// [`std::fmt`]: ../std/fmt/index.html /// [`print!`]: ../std/macro.print.html /// [`write!`]: core::write /// [`to_string`]: crate::string::ToString |
