Skip to content

Tracking Issue for generic NonZero #120257

Closed

Description

@reitermarkus

Feature gate: #![feature(generic_nonzero)]

This is a tracking issue for replacing the distinct NonZero* types with a generic NonZero<T> type. This allows using NonZero with FFI type aliases instead of having weird type names like NonZero_c_ulonglong.

This replaces the following tracking issues:

Public API

use core::num::{NonZero, NonZeroU8};

assert_eq!(NonZero::new(33u8), NonZeroU8::new(33));

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libs-api[DEPRECATED; DO NOT USE]
    on Jan 23, 2024
  2. added a commit that references this issue on Jan 30, 2024
  3. added a commit that references this issue on Jan 30, 2024
  4. reitermarkus commented on Jan 31, 2024

    @reitermarkus
    ContributorAuthor

    @dtolnay, given the documentation issue, making NonZero::new and other constructors generic can really only be done during/after stabilization, so the only blocker I can see right now is stabilization itself. Can this enter FCP, or do we want to wait for #120486?

  5. added 7 commits that reference this issue on Feb 3, 2024
  6. added 2 commits that reference this issue on Feb 7, 2024
  7. 93 remaining items

  8. added 2 commits that reference this issue on May 8, 2024
  9. added a commit that references this issue on May 8, 2024
  10. added a commit that references this issue on Sep 19, 2024
  11. added a commit that references this issue on Feb 6, 2025
  12. dhardy commented on Nov 19, 2025

    @dhardy
    Contributor

    This issue is marked as closed, yet it depends on an unstable trait: ZeroablePrimitive. This blocks a lot of use-cases.

    Should there be a separate tracking issue for ZeroablePrimitive? I do not see one.

  13. RalfJung commented on Nov 19, 2025

    @RalfJung
    Member

    ZeroablePrimitive is currently guarded by the nonzero_internals feature gate. The "internal" part indicates it is not intended for stabilization and therefore has no tracking issue.

    I would suggest filing an ACP if you want to make that trait more than just an internal implementation detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions