diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-11-16 17:26:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-16 17:26:17 +0100 |
| commit | 5bbf75da78393343b155c8bfcf1ef9c0234d9ab1 (patch) | |
| tree | 4f16806e19dac4408029ca35ed628ef5a98a98f1 /library/alloc | |
| parent | de0aa6169f0c7abbc8aa4d7e735f5da57a1e65ab (diff) | |
| parent | 8ff0c14dc50483d0b231f9bad3d1eec8556c3750 (diff) | |
| download | rust-5bbf75da78393343b155c8bfcf1ef9c0234d9ab1.tar.gz rust-5bbf75da78393343b155c8bfcf1ef9c0234d9ab1.zip | |
Rollup merge of #77691 - exrook:rename-layouterr, r=KodrAus
Rename/Deprecate LayoutErr in favor of LayoutError Implements rust-lang/wg-allocators#73. This patch renames LayoutErr to LayoutError, and uses a type alias to support users using the old name. The new name will be instantly stable in release 1.49 (current nightly), the type alias will become deprecated in release 1.51 (so that when the current nightly is 1.51, 1.49 will be stable). This is the only error type in `std` that ends in `Err` rather than `Error`, if this PR lands all stdlib error types will end in `Error` :smiling_face_with_three_hearts:
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/collections/mod.rs | 6 | ||||
| -rw-r--r-- | library/alloc/src/raw_vec.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/library/alloc/src/collections/mod.rs b/library/alloc/src/collections/mod.rs index 6b21e54f66a..8213e904fba 100644 --- a/library/alloc/src/collections/mod.rs +++ b/library/alloc/src/collections/mod.rs @@ -41,7 +41,7 @@ pub use linked_list::LinkedList; #[doc(no_inline)] pub use vec_deque::VecDeque; -use crate::alloc::{Layout, LayoutErr}; +use crate::alloc::{Layout, LayoutError}; use core::fmt::Display; /// The error type for `try_reserve` methods. @@ -71,9 +71,9 @@ pub enum TryReserveError { } #[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] -impl From<LayoutErr> for TryReserveError { +impl From<LayoutError> for TryReserveError { #[inline] - fn from(_: LayoutErr) -> Self { + fn from(_: LayoutError) -> Self { TryReserveError::CapacityOverflow } } diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index a4240308bb3..522c5bcf5af 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -1,7 +1,7 @@ #![unstable(feature = "raw_vec_internals", reason = "implementation detail", issue = "none")] #![doc(hidden)] -use core::alloc::LayoutErr; +use core::alloc::LayoutError; use core::cmp; use core::intrinsics; use core::mem::{self, ManuallyDrop, MaybeUninit}; @@ -472,7 +472,7 @@ impl<T, A: AllocRef> RawVec<T, A> { // significant, because the number of different `A` types seen in practice is // much smaller than the number of `T` types.) fn finish_grow<A>( - new_layout: Result<Layout, LayoutErr>, + new_layout: Result<Layout, LayoutError>, current_memory: Option<(NonNull<u8>, Layout)>, alloc: &mut A, ) -> Result<NonNull<[u8]>, TryReserveError> |
