| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
Add partialeq implementation for TryFromIntError type
Fixes #53458.
|
|
|
|
add individual docs to `core::num::NonZero*`
|
|
|
|
|
|
Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers.
Tracking issue: https://github.com/rust-lang/rust/issues/52963
|
|
|
|
Add individual docs for rotate_{left, right}
|
|
|
|
|
|
Remove redundant field names in structs
|
|
|
|
The old issue has already been in FCP, a new issue was opened for the
new API.
|
|
If one doesn't view integers as containers of bytes, converting them to
bytes necessarily needs the specfication of encoding.
I think Rust is a language that wants to be explicit. The `to_bytes`
function is basically the opposite of that – it converts an integer into
the native byte representation, but there's no mention (in the function
name) of it being very much platform dependent. Therefore, I think it
would be better to replace that method by three methods, the explicit
`to_ne_bytes` ("native endian") which does the same thing and
`to_{le,be}_bytes` which return the little- resp. big-endian encoding.
|
|
This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7.
|
|
The previous syntax was causing rustdoc to interpret them as links.
|
|
|
|
Add #[repr(transparent)] to some libcore types
* `UnsafeCell`
* `Cell`
* `NonZero*`
* `NonNull`
* `Unique`
CC https://github.com/rust-lang/rust/issues/43036
|
|
Implement always-fallible TryFrom for usize/isize conversions that are infallible on some platforms
This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a "Remove TryFrom impls that might become conditionally-infallible with a portability lint".
This fixes #49415 by adding (restoring) missing `TryFrom` impls for integer conversions to or from `usize` or `isize`, by making them always fallible at the type system level (that is, with `Error=TryFromIntError`) even though they happen to be infallible on some platforms (for some values of `size_of::<usize>()`).
They had been removed to allow the possibility to conditionally having some of them be infallible `From` impls instead, depending on the platforms, and have the [portability lint](https://github.com/rust-lang/rfcs/pull/1868) warn when they are used in code that is not already opting into non-portability. For example `#[allow(some_lint)] usize::from(x: u64)` would be valid on code that only targets 64-bit platforms.
This PR gives up on this possiblity for two reasons:
* Based on discussion with @aturon, it seems that the portability lint is not happening any time soon. It’s better to have the conversions be available *at all* than keep blocking them for so long. Portability-lint-gated platform-specific APIs can always be added separately later.
* For code that is fine with fallibility, the alternative would force it to opt into "non-portability" even though there would be no real portability issue.
|
|
|
|
Fixes #49792
|
|
* `UnsafeCell`
* `Cell`
* `NonZero*`
* `NonNull`
* `Unique`
|
|
|
|
Closes #49137, the tracking issue for `NonZero*`,
as this was the last remaining open question.
Note that `ptr::NonNull<T>` already documents a similar guarantee.
|
|
a portability lint"
This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a.
Fixes https://github.com/rust-lang/rust/issues/49415
|
|
const fn integer operations
A follow up to #51171
Fixes #51267
Makes a lot of the integer methods (`swap_bytes`, `count_ones` etc) `const fn`s. See #51267 for a discussion about why this is wanted and the solution used.
|
|
Provide more context for what the {f32,f64}::EPSILON values represent.
Introduce the 'machine epsilon' term because if one googles 'epsilon', they might stumble upon https://en.wikipedia.org/wiki/Epsilon_numbers_(mathematics) instead of https://en.wikipedia.org/wiki/Machine_epsilon
|
|
|
|
|
|
Add From<bool> for int types
Fixes #46109.
|
|
|
|
|
|
Add missing Wrapping methods, use doc_comment!
Re-opened version of #49393 . Finishing touches for #32463.
Note that this adds `Shl` and `Shr` implementations for `Wrapping<i128>` and `Wrapping<u128>`, which were previously missed. This is technically insta-stable, but I don't know why this would be a problem.
|
|
|
|
Following up to #49896 and #50629. Fixes #32110.
E0689 is weird.
|
|
|
|
Stabilize num::NonZeroU*
Tracking issue: https://github.com/rust-lang/rust/issues/49137
|
|
Tracking issue: https://github.com/rust-lang/rust/issues/49137
|
|
|
|
It is now an implementation detail of ptr::NonNull and num::NonZero*
|
|
just a small typo.
|
|
|
|
|
|
|
|
|
|
|