-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add From<{integer}>
for f16
/f128
impls
#138363
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
8767c41
to
7c07265
Compare
Obligatory crater run since we've had trouble with f16/f128 stdlib impls in the past :) edit: oh i just read that you also asked for a crater run; yep, agreed lol @bors try |
…=<try> Add `From<{integer}>` for `f16`/`f128` impls This PR adds `impl From<{bool,i8,u8}> for f16` and `impl From<{bool,i8,u8,i16,u16,i32,u32}> for f128`. The `From<{i64,u64}> for f128` impls are left commented out as adding them would allow using `f128` on stable before it is stabilised like in the following example: ```rust fn f<T: From<u64>>(x: T) -> T { x } fn main() { let x = f(1.0); // the type of the literal is inferred to be `f128` } ``` None of the impls added in this PR have this issue as they are all, at minimum, also implemented by `f64`. This PR will need a crater run for the `From<{i32,u32}>` impls, as `f64` is no longer the only float type to implement them (similar to the cause of rust-lang#125198). cc `@bjoernager` r? `@tgross35` Tracking issue: rust-lang#116909
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
This LGTM assuming crater is okay, but somebody from libs-api will need to approve r? @Amanieu |
This PR adds
impl From<{bool,i8,u8}> for f16
andimpl From<{bool,i8,u8,i16,u16,i32,u32}> for f128
.The
From<{i64,u64}> for f128
impls are left commented out as adding them would allow usingf128
on stable before it is stabilised like in the following example:None of the impls added in this PR have this issue as they are all, at minimum, also implemented by
f64
.This PR will need a crater run for the
From<{i32,u32}>
impls, asf64
is no longer the only float type to implement them (similar to the cause of #125198).cc @bjoernager
r? @tgross35
Tracking issue: #116909