Make `NonZero` constructors generic. by reitermarkus · Pull Request #120521 · rust-lang/rust

@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

Jan 31, 2024

dtolnay

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jan 31, 2024

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Feb 1, 2024

@bors bors 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

Feb 1, 2024

This was referenced

Feb 1, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 3, 2024
…ructors, r=dtolnay,oli-obk

Make `NonZero` constructors generic.

This makes `NonZero` constructors generic, so that `NonZero::new` can be used without turbofish syntax.

Tracking issue: rust-lang#120257

~~I cannot figure out how to make this work with `const` traits. Not sure if I'm using it wrong or whether there's a bug:~~

```rust
101 |         if n == T::ZERO {
    |            ^^^^^^^^^^^^ expected `host`, found `true`
    |
    = note: expected constant `host`
               found constant `true`
```

r? `@dtolnay`

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 4, 2024
…ructors, r=dtolnay,oli-obk

Make `NonZero` constructors generic.

This makes `NonZero` constructors generic, so that `NonZero::new` can be used without turbofish syntax.

Tracking issue: rust-lang#120257

~~I cannot figure out how to make this work with `const` traits. Not sure if I'm using it wrong or whether there's a bug:~~

```rust
101 |         if n == T::ZERO {
    |            ^^^^^^^^^^^^ expected `host`, found `true`
    |
    = note: expected constant `host`
               found constant `true`
```

r? ``@dtolnay``

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 5, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 5, 2024
…ructors, r=dtolnay,oli-obk

Make `NonZero` constructors generic.

This makes `NonZero` constructors generic, so that `NonZero::new` can be used without turbofish syntax.

Tracking issue: rust-lang#120257

~~I cannot figure out how to make this work with `const` traits. Not sure if I'm using it wrong or whether there's a bug:~~

```rust
101 |         if n == T::ZERO {
    |            ^^^^^^^^^^^^ expected `host`, found `true`
    |
    = note: expected constant `host`
               found constant `true`
```

r? ```@dtolnay```

This was referenced

Feb 8, 2024

scottmcm

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 9, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 9, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 9, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 9, 2024

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Feb 9, 2024

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Feb 10, 2024

oli-obk added a commit to oli-obk/rust that referenced this pull request

Feb 13, 2024

oli-obk added a commit to oli-obk/rust that referenced this pull request

Feb 13, 2024

oli-obk added a commit to oli-obk/rust that referenced this pull request

Feb 15, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 16, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 17, 2024

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Feb 17, 2024

lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request

Apr 7, 2024

RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request

Apr 27, 2024