rust-lang / rust-lang/rust

Tracking Issue for `f32_from_f16`

Open
#154,005 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(f32_from_f16)]

This is a tracking issue the From<f16> for f32 instance. Issue https://github.com/rust-lang/rust/issues/123831 describes the problem:

Adding a From for f32 impl breaks some inference that currently works. From https://github.com/rust-lang/rust/issues/123824:

fn main() {
    let x = f32::from(3.14);
}

The type checker now implements a workaround to keep that code compiling in the presence of the f16 implementation. Because that is a workaround, and we might get a better solution in the future, the implementation is kept unstable for now.

Public API
From<f16> for f32 { /* ... */ }
Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the implementation PR 139087 and the related issues 123831 and 123824 to understand the inference workaround behind From<f16> for f32. Follow the tracking checklist for the final comment period and stabilization PR; the work is done when the unresolved questions are settled and both remaining checklist steps are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.