diff options
| author | bors <bors@rust-lang.org> | 2022-10-18 13:35:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-18 13:35:43 +0000 |
| commit | e94827e5b09b5b098ea10d0c57a84892fc73b5a7 (patch) | |
| tree | 1b68930008142c76d8d72208ab23fd192ba04884 /library/core/src/array | |
| parent | 21b246587c2687935bd6004ffa5dcc4f4dd6600d (diff) | |
| parent | 6e7d206a7bd2ea10c151a0916e3f325b14e91311 (diff) | |
| download | rust-e94827e5b09b5b098ea10d0c57a84892fc73b5a7.tar.gz rust-e94827e5b09b5b098ea10d0c57a84892fc73b5a7.zip | |
Auto merge of #103188 - JohnTitor:rollup-pwilam1, r=JohnTitor
Rollup of 6 pull requests Successful merges: - #103023 (Adding `fuchsia-ignore` and `needs-unwind` to compiler test cases) - #103142 (Make diagnostic for unsatisfied `Termination` bounds more precise) - #103154 (Fix typo in `ReverseSearcher` docs) - #103159 (Remove the redundant `Some(try_opt!(..))` in `checked_pow`) - #103163 (Remove all uses of array_assume_init) - #103168 (Stabilize asm_sym) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/iter.rs | 5 | ||||
| -rw-r--r-- | library/core/src/array/mod.rs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index b3b26040067..b91c630183d 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -104,8 +104,7 @@ impl<T, const N: usize> IntoIter<T, N> { /// /// ``` /// #![feature(array_into_iter_constructors)] - /// - /// #![feature(maybe_uninit_array_assume_init)] + /// #![feature(maybe_uninit_uninit_array_transpose)] /// #![feature(maybe_uninit_uninit_array)] /// use std::array::IntoIter; /// use std::mem::MaybeUninit; @@ -134,7 +133,7 @@ impl<T, const N: usize> IntoIter<T, N> { /// } /// /// // SAFETY: We've initialized all N items - /// unsafe { Ok(MaybeUninit::array_assume_init(buffer)) } + /// unsafe { Ok(buffer.transpose().assume_init()) } /// } /// /// let r: [_; 4] = next_chunk(&mut (10..16)).unwrap(); diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index b82bbf2267a..04dd821efde 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -912,7 +912,7 @@ where mem::forget(guard); // SAFETY: All elements of the array were populated in the loop above. - let output = unsafe { MaybeUninit::array_assume_init(array) }; + let output = unsafe { array.transpose().assume_init() }; Ok(Try::from_output(output)) } |
