diff options
| author | bors <bors@rust-lang.org> | 2022-10-19 11:12:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-19 11:12:10 +0000 |
| commit | d7dd01fe8b071602510eaac9f676acc0e3cf8e4a (patch) | |
| tree | 85d7503010195d972b60fdbae9277584b67983a1 /library/core | |
| parent | 5605ed85363345f3def5da6b1ead2ac0b803bfe7 (diff) | |
| parent | 32159e3fa4bc9940f96bfb5fb30120c509ab259a (diff) | |
| download | rust-d7dd01fe8b071602510eaac9f676acc0e3cf8e4a.tar.gz rust-d7dd01fe8b071602510eaac9f676acc0e3cf8e4a.zip | |
Auto merge of #103228 - Dylan-DPC:rollup-31yiauw, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #102863 (Standardize "use parentheses to call" suggestions between typeck and trait selection) - #103034 (Let expressions on RHS shouldn't be terminating scopes) - #103127 (Make transpose const and inline) - #103153 (Allow `Vec::leak` when using `no_global_oom_handling`) - #103182 (Clean up query descriptions) - #103216 (Consider patterns in fn params in an `Elided(Infer)` lifetime rib.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/src/mem/maybe_uninit.rs | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index da84763836e..2fd8180f8b2 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -217,6 +217,7 @@ #![feature(unboxed_closures)] #![feature(unsized_fn_params)] #![feature(asm_const)] +#![feature(const_transmute_copy)] // // Target features: #![feature(arm_target_feature)] diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 2ae96367628..efad9a9391b 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -1297,7 +1297,8 @@ impl<T, const N: usize> MaybeUninit<[T; N]> { /// let data: [MaybeUninit<u8>; 1000] = MaybeUninit::uninit().transpose(); /// ``` #[unstable(feature = "maybe_uninit_uninit_array_transpose", issue = "96097")] - pub fn transpose(self) -> [MaybeUninit<T>; N] { + #[inline] + pub const fn transpose(self) -> [MaybeUninit<T>; N] { // SAFETY: T and MaybeUninit<T> have the same layout unsafe { super::transmute_copy(&ManuallyDrop::new(self)) } } @@ -1316,7 +1317,8 @@ impl<T, const N: usize> [MaybeUninit<T>; N] { /// let data: MaybeUninit<[u8; 1000]> = data.transpose(); /// ``` #[unstable(feature = "maybe_uninit_uninit_array_transpose", issue = "96097")] - pub fn transpose(self) -> MaybeUninit<[T; N]> { + #[inline] + pub const fn transpose(self) -> MaybeUninit<[T; N]> { // SAFETY: T and MaybeUninit<T> have the same layout unsafe { super::transmute_copy(&ManuallyDrop::new(self)) } } |
