mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
9f2ad0a061
Make more `From` impls `const` (libcore) Adding `const` to `From` implementations in the core. `rustc_const_unstable` attribute is not added to unstable implementations. Tracking issue: #88674 <details> <summary>Done</summary><div> - `T` from `T` - `T` from `!` - `Option<T>` from `T` - `Option<&T>` from `&Option<T>` - `Option<&mut T>` from `&mut Option<T>` - `Cell<T>` from `T` - `RefCell<T>` from `T` - `UnsafeCell<T>` from `T` - `OnceCell<T>` from `T` - `Poll<T>` from `T` - `u32` from `char` - `u64` from `char` - `u128` from `char` - `char` from `u8` - `AtomicBool` from `bool` - `AtomicPtr<T>` from `*mut T` - `AtomicI(bits)` from `i(bits)` - `AtomicU(bits)` from `u(bits)` - `i(bits)` from `NonZeroI(bits)` - `u(bits)` from `NonZeroU(bits)` - `NonNull<T>` from `Unique<T>` - `NonNull<T>` from `&T` - `NonNull<T>` from `&mut T` - `Unique<T>` from `&mut T` - `Infallible` from `!` - `TryIntError` from `!` - `TryIntError` from `Infallible` - `TryFromSliceError` from `Infallible` - `FromResidual for Option<T>` </div></details> <details> <summary>Remaining</summary><dev> - `NonZero` from `NonZero` These can't be made const at this time because these use Into::into. https://github.com/rust-lang/rust/blob/master/library/core/src/convert/num.rs#L393 - `std`, `alloc` There may still be many implementations that can be made `const`. </div></details> |
||
---|---|---|
.. | ||
alloc | ||
backtrace@7f14f76c8b | ||
core | ||
panic_abort | ||
panic_unwind | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@5fdbc476af | ||
test | ||
unwind |