diff options
| author | bors <bors@rust-lang.org> | 2025-06-18 03:18:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-18 03:18:10 +0000 |
| commit | 27733d46d79f4eb92e240fbba502c43022665735 (patch) | |
| tree | be5214bb2385eb8d2b35bf47e14924a9a3b712e6 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 77ec48f5642ee1aa451d270f11f308c297f55f76 (diff) | |
| parent | 8f77681656c47aa09d1b66f87dc249aae1694d07 (diff) | |
| download | rust-27733d46d79f4eb92e240fbba502c43022665735.tar.gz rust-27733d46d79f4eb92e240fbba502c43022665735.zip | |
Auto merge of #130887 - Soveu:repeatn, r=scottmcm
Safer implementation of RepeatN I've seen the "Use MaybeUninit for RepeatN" commit while reading This Week In Rust and immediately thought about something I've written some time ago - https://github.com/Soveu/repeat_finite/blob/master/src/lib.rs. Using the fact, that `Option` will find niche in `(T, NonZeroUsize)`, we can construct something that has the same size as `(T, usize)` while completely getting rid of `MaybeUninit`. This leaves only `unsafe` on `TrustedLen`, which is pretty neat.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions
