| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Stabilize assoc_int_consts associated int/float constants
The next step in RFC https://github.com/rust-lang/rfcs/pull/2700 (tracking issue #68490). Stabilizing the associated constants that were added in #68325.
* Stabilize all constants under the `assoc_int_consts` feature flag.
* Update documentation on old constants to say they are soft-deprecated and the new ones should be preferred.
* Update documentation examples to use new constants.
* Remove `uint_macro` and use `int_macro` for all integer types since the macros were identical anyway.
r? @LukasKalbertodt
|
|
|
|
Add primitive module to libcore
This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.
Fixes #44865
|
|
|
|
All of these functions can be implemented simply and naturally as
const functions, e.g. u32::from_le_bytes can be implemented as
(bytes[0] as u32)
| (bytes[1] as u32) << 8
| (bytes[2] as u32) << 16
| (bytes[3] as u32) << 24
So stabilizing the constness will not expose that internally they are
implemented using transmute which is not const in stable.
|
|
Make integer exponentiation methods unstably const
cc #53718
This makes the following inherent methods on integer primitives into unstable `const fn`:
- `pow`
- `checked_pow`
- `wrapping_pow`
- `overflowing_pow`
- `saturating_pow`
- `next_power_of_two`
- `checked_next_power_of_two`
- `wrapping_next_power_of_two`
Only two changes were made to the implementation of these methods. First, I had to switch from the `?` operator, which is not yet implemented in a const context, to a `try_opt` macro. Second, `next_power_of_two` was using `ops::Add::add` (see the first commit) to "get overflow checks", so I switched to `#[rustc_inherit_overflow_checks]`. I'm not quite sure why the attribute wasn't used in the first place.
|
|
|
|
|
|
Hide niches under UnsafeCell
Hide any niche of T from type-construction context of `UnsafeCell<T>`.
Fix #68303
Fix #68206
|
|
|
|
|
|
|
|
This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.
|
|
|
|
|
|
Co-Authored-By: 9999years <rbt@sent.as>
|
|
Co-Authored-By: 9999years <rbt@sent.as>
|
|
Co-Authored-By: 9999years <rbt@sent.as>
|
|
Co-Authored-By: 9999years <rbt@sent.as>
|
|
Step stage0 to bootstrap from 1.42
This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
|
|
|
|
|
|
|
|
|
|
|
|
Tracking issue #67521, Layout::new in #66254
|
|
This flag opts out of the min-const-fn checks entirely, which is usually
not what we want. The few cases where the flag is still necessary have
been annotated.
|
|
|
|
|
|
|
|
Use slice patterns to avoid having to skip bounds checking
|
|
Require const stability attributes on intrinsics to be able to use them in constant contexts
r? @Centril
finally fixes #61495
cc @RalfJung
|
|
|
|
constant contexts
|
|
|
|
r=centril
Revert stabilization of never type
Fixes https://github.com/rust-lang/rust/issues/66757
I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean.
( cc @Centril, author of #65355, you may want to check this over briefly )
|
|
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.
|
|
|
|
|
|
So that we can bootstrap successfully
|
|
|
|
|
|
|
|
|
|
This commit stabilizes RFC 2008 (#44109) by removing the feature gate.
Signed-off-by: David Wood <david@davidtw.co>
|
|
Tracking issue: https://github.com/rust-lang/rust/issues/61129
|
|
|
|
|
|
Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently
requires a submodule update of `stdarch` to fix a problem with previous
compilers.
|