-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix 'FIXME' about using NonZeroU32 instead of u32. #76851
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
It was blocked by rust-lang#58732 (const fn NonZeroU32::new), which is fixed now.
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. Having the Feature::issue field make 0 impossible to store is an improvement, even if to_nonzero
is needed. A const and_then
is likely much further out as it involves figuring out how to do a const callable FnOnce -- related to rust-lang/rfcs#2632 I guess.
Co-authored-by: David Tolnay <dtolnay@gmail.com>
@bors r+ |
📌 Commit 2140d80 has been approved by |
…ero, r=petrochenkov Fix 'FIXME' about using NonZeroU32 instead of u32. It was blocked by rust-lang#58732 (const fn NonZeroU32::new), which is fixed now.
Rollup of 11 pull requests Successful merges: - rust-lang#76851 (Fix 'FIXME' about using NonZeroU32 instead of u32.) - rust-lang#76979 (Improve std::sys::windows::compat) - rust-lang#77111 (Stabilize slice_ptr_range.) - rust-lang#77147 (Split sys_common::Mutex in StaticMutex and MovableMutex.) - rust-lang#77312 (Remove outdated line from `publish_toolstate` hook) - rust-lang#77362 (Fix is_absolute on WASI) - rust-lang#77375 (rustc_metadata: Do not forget to encode inherent impls for foreign types) - rust-lang#77385 (Improve the example for ptr::copy) - rust-lang#77389 (Fix some clippy lints) - rust-lang#77399 (BTreeMap: use Unique::from to avoid a cast where type information exists) - rust-lang#77429 (Link `new` method in `DefautHasher`s doc) Failed merges: r? `@ghost`
It was blocked by #58732 (const fn NonZeroU32::new), which is fixed now.