diff options
| author | bors <bors@rust-lang.org> | 2024-04-23 00:05:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-23 00:05:31 +0000 |
| commit | 9cf10bcf5b368de79abc24fc4d50a9d85b377ffa (patch) | |
| tree | 975fed41d85532188712e2944555a73106f0f538 /library/core/src/array/mod.rs | |
| parent | 25087e02b34775520856b6cc15e50f5ed0c35f50 (diff) | |
| parent | 000d0f9116c24c0e24a30e18bfd84f913b099520 (diff) | |
| download | rust-9cf10bcf5b368de79abc24fc4d50a9d85b377ffa.tar.gz rust-9cf10bcf5b368de79abc24fc4d50a9d85b377ffa.zip | |
Auto merge of #124271 - GuillaumeGomez:rollup-7st9wd7, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #115913 (checked_ilog: improve performance) - #124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - #124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - #124217 (coverage: Prepare for improved branch coverage) - #124230 (Stabilize generic `NonZero`.) - #124252 (Improve ICE message for forbidden dep-graph reads.) - #124268 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src/array/mod.rs')
| -rw-r--r-- | library/core/src/array/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 2a447aafe72..05874ab6c4c 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -512,7 +512,8 @@ impl<T, const N: usize> [T; N] { /// # Examples /// /// ``` - /// #![feature(array_try_map, generic_nonzero)] + /// #![feature(array_try_map)] + /// /// let a = ["1", "2", "3"]; /// let b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1); /// assert_eq!(b, [2, 3, 4]); @@ -522,8 +523,10 @@ impl<T, const N: usize> [T; N] { /// assert!(b.is_err()); /// /// use std::num::NonZero; + /// /// let z = [1, 2, 0, 3, 4]; /// assert_eq!(z.try_map(NonZero::new), None); + /// /// let a = [1, 2, 3]; /// let b = a.try_map(NonZero::new); /// let c = b.map(|x| x.map(NonZero::get)); |
