Skip to content

Constify impl FromStr for NonZero<T> - #162995

Open
sorairolake wants to merge 1 commit into
rust-lang:mainfrom
sorairolake:const-nonzero-from-str
Open

sorairolake wants to merge 1 commit into
rust-lang:mainfrom
sorairolake:const-nonzero-from-str

Conversation

@sorairolake

@sorairolake sorairolake commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

<integer>::from_str has been const. NonZero::from_str can also be const.

#143773

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 19, 2026
@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@jhpratt

jhpratt commented Sep 19, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 75b444d has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 19, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 19, 2026
…, r=jhpratt

Constify `impl FromStr for NonZero<T>`

`<integer>::from_str` has been `const`. `NonZero::from_str` can also be `const`.

rust-lang#143773
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup of 13 pull requests

Successful merges:

 - #158515 (Make let-else respect macro_rules expr metavariable grouping)
 - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor)
 - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner)
 - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes)
 - #162990 (post GH comment on types nominations)
 - #154665 (add safety section for mem::zeroed)
 - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription)
 - #162705 (Trigger "C array" parse error recovery in far fewer cases)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162988 (recover `true` and `false` in type position as `bool`)
 - #162995 (Constify `impl FromStr for NonZero<T>`)
 - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics)
 - #163007 (add Dir::try_clone)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 19, 2026
…, r=jhpratt

Constify `impl FromStr for NonZero<T>`

`<integer>::from_str` has been `const`. `NonZero::from_str` can also be `const`.

rust-lang#143773
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #158515 (Make let-else respect macro_rules expr metavariable grouping)
 - #162726 (std: fix unix socket address panic on a full sun_path)
 - #160028 (Better account for `Self` that might be a typo of `self`)
 - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor)
 - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner)
 - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes)
 - #162990 (post GH comment on types nominations)
 - #154665 (add safety section for mem::zeroed)
 - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription)
 - #162705 (Trigger "C array" parse error recovery in far fewer cases)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162988 (recover `true` and `false` in type position as `bool`)
 - #162995 (Constify `impl FromStr for NonZero<T>`)
 - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics)
 - #163007 (add Dir::try_clone)
mu001999 added a commit to mu001999/rust that referenced this pull request Sep 20, 2026
…, r=jhpratt

Constify `impl FromStr for NonZero<T>`

`<integer>::from_str` has been `const`. `NonZero::from_str` can also be `const`.

rust-lang#143773
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants