Commit Graph

16 Commits

Author SHA1 Message Date
Markus Reiter a90cc05233
Replace `NonZero::<_>::new` with `NonZero::new`. 2024-02-15 08:09:42 +01:00
Markus Reiter 746a58d435
Use generic `NonZero` internally. 2024-02-15 08:09:42 +01:00
surechen 40ae34194c remove redundant imports
detects redundant imports that can be eliminated.

for #117772 :

In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
2023-12-10 10:56:22 +08:00
John Millikin 4e2797dd76 Implement `Neg` for signed non-zero integers.
Negating a non-zero integer currently requires unpacking to a
primitive and re-wrapping. Since negation of non-zero signed
integers always produces a non-zero result, it is safe to
implement `Neg` for `NonZeroI{N}`.

The new `impl` is marked as stable because trait implementations
for two stable types can't be marked unstable.
2023-04-20 14:27:29 +09:00
Deadbeef 4c6ddc036b fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
woppopo 2fc780638e Make `From` impls of NonZero integer const.
I also changed the feature gate added to `From` impls of Atomic integer to `const_num_from_num` from `const_convert`.
2021-10-20 12:04:58 +09:00
woppopo 7936ecff48 Make more `From` impls `const` 2021-10-18 19:19:28 +09:00
Ohad Ravid 1e9e30dc40 Added `impl Rem<NonZeroU{0}> for u{0}` which cannot panic 2020-12-17 18:42:19 +02:00
Ohad Ravid 3f671bc944 Added `impl Div<NonZeroU{0}> for u{0}` which cannot panic 2020-12-17 18:41:47 +02:00
Mara Bos 9e3b949b8c Fix braces in panic message in test. 2020-10-19 10:07:30 +02:00
Andreas Jonson 9bbc4c16d3 add trailing_zeros and leading_zeros to non zero types 2020-11-17 19:54:29 +01:00
Ethan Brierley ad2d93da1f Apply suggested changes 2020-10-26 18:14:12 +00:00
Ethan Brierley 83d294f06a Bring char along with InvalidDigit 2020-10-06 19:05:25 +01:00
Ethan Brierley c027844795 Fill in things needed to stabilize int_error_matching 2020-10-06 14:06:25 +01:00
Christiaan Dirkx 538e198193 Move various ui const tests to `library`
Move:
 - `src\test\ui\consts\const-nonzero.rs` to `library\core`
 - `src\test\ui\consts\ascii.rs` to `library\core`
 - `src\test\ui\consts\cow-is-borrowed` to `library\alloc`

Part of #76268
2020-09-04 02:35:27 +02:00
mark 2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00