about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-08 03:00:34 +0000
committerbors <bors@rust-lang.org>2024-02-08 03:00:34 +0000
commit384b02c0825cefa59f2e8a99a33d9a5344959079 (patch)
tree3fe0ab30a49eca5360ec58ccc80be161ba8c4095 /compiler/rustc_parse/src
parent6894f435d35d3d540dcefbc51390158ca5954861 (diff)
parent42298756c740e217058c4fedebf2063192246ae0 (diff)
downloadrust-384b02c0825cefa59f2e8a99a33d9a5344959079.tar.gz
rust-384b02c0825cefa59f2e8a99a33d9a5344959079.zip
Auto merge of #120521 - reitermarkus:generic-nonzero-constructors, r=dtolnay
Make `NonZero` constructors generic.

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

Tracking issue: https://github.com/rust-lang/rust/issues/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`
Diffstat (limited to 'compiler/rustc_parse/src')
0 files changed, 0 insertions, 0 deletions