Closed
Description
After this rollup we started seeing the following compile failure:
fn main() {
let x = f32::from(3.14);
}
error[E0277]: the trait bound `f32: From<f64>` is not satisfied
--> /tmp/repro.rs:2:13
|
16 | let x = f32::from(3.14);
| ^^^ the trait `From<f64>` is not implemented for `f32`
|
= help: the following other types implement trait `From<T>`:
<f32 as From<bool>>
<f32 as From<f16>>
<f32 as From<i16>>
<f32 as From<i8>>
<f32 as From<u16>>
<f32 as From<u8>>
error: aborting due to 1 previous error
I repro'd this locally on aa6a697 but we have CI that runs on every commit so we're fairly sure that it started with 4435924. Of the changes in that rollup #122470 is the only one that seemed to touch float stuff, but I'm not sure how adding some extra impls for f16
and f128
would break inference in this case.
Metadata
Metadata
Assignees
Labels
Area: Type inferenceCategory: This is a bug.`#![feature(f16)]`, `#![feature(f128)]`Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.