forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#90009 - woppopo:const_from_more, r=dtolnay
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: rust-lang#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>
- Loading branch information
Showing
19 changed files
with
103 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters