-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for const_num_from_num #87852
Comments
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`. Tracking issue: rust-lang#87852
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`. Tracking issue: rust-lang#87852
|
Is this still feature a thing? Rust doesn't recognize the feature name when I enable it on the latest nightly.
But also numeric |
All const trait impls are currently disabled while the backing implementation is being reworked |
This has been removed by #110393. |
Feature gate:
#![feature(const_num_from_num)]
This is a tracking issue for constifying the
impl From<U> for T
andimpl TryFrom<U> for T
for conversions between the basic built in numeric types(bothT
andU
are one off32
,f64
,iX
,uX
). It also constifies the correspondingFrom
conversions forNonZeroUX
andNonZeroIX
and fromNonZeroUX
/NonZeroIX
touX
/iX
of same type and signedness. AdditionallyAtomicUX
fromuX
andAtomicIX
fromiX
, this is however only for types of same size.Note that all of this does not add any new implementations, it only constifies the existing ones.
In short, this will enable things like below without having to use
as
castsPublic API
# TODO
Steps / History
(Try)From
for int types #86840From
impls of NonZero integer const. #90077Unresolved Questions
The text was updated successfully, but these errors were encountered: