Skip to content
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

Remove From impls for unstable types that break inference #123830

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Apr 11, 2024

Adding additional From implementations that fit f32::from(<unaffixed float>) broke inference. Remove these for now.

I added a test to make sure this doesn't quietly change in the future, even though the behavior is not technically guaranteed #123824 (comment)

Fixes: #123824

@rustbot
Copy link
Collaborator

rustbot commented Apr 11, 2024

r? @Nilstrieb

rustbot has assigned @Nilstrieb.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 11, 2024
Adding additional `From` implementations that fit `f32::from(<unaffixed
float>)` broke inference. Remove these for now.

Fixes: <rust-lang#123824>
@tgross35 tgross35 force-pushed the f16-f128-from-inference-fix branch from f48cd1c to 9bcc988 Compare April 11, 2024 22:04
@tgross35
Copy link
Contributor Author

This only changes unstable API so I think it ok for somebody from libs (rather than libs-api) to review.

@rustbot label +F-f16_and_f128

@rustbot rustbot added the F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` label Apr 11, 2024
@Noratrieb
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 12, 2024

📌 Commit 9bcc988 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2024
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#123796 (Remove unused cargo-platform dependency from tidy)
 - rust-lang#123830 (Remove `From` impls for unstable types that break inference)
 - rust-lang#123842 (fix typo in pin.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bcf24d6 into rust-lang:master Apr 12, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2024
Rollup merge of rust-lang#123830 - tgross35:f16-f128-from-inference-fix, r=Nilstrieb

Remove `From` impls for unstable types that break inference

Adding additional `From` implementations that fit `f32::from(<unaffixed float>)` broke inference. Remove these for now.

I added a test to make sure this doesn't quietly change in the future, even though the behavior is not technically guaranteed rust-lang#123824 (comment)

Fixes: <rust-lang#123824>
@tgross35 tgross35 deleted the f16-f128-from-inference-fix branch April 12, 2024 16:41
bors added a commit to rust-lang-ci/rust that referenced this pull request May 5, 2024
Re-add `From<f16> for f64`

This impl was originally added in rust-lang#122470 before being removed in rust-lang#123830 due to rust-lang#123831. However, the issue only affects `f32` (which currently only has one `From<{float}>` impl, `From<f32>`) as `f64` already has two `From<{float}>` impls (`From<f32>` and `From<f64>`) and is also the float literal fallback type anyway. Therefore it is safe to re-add `From<f16> for f64`.

This PR also updates the FIXME link to point to the open issue rust-lang#123831 rather than the closed issue rust-lang#123824.

Tracking issue: rust-lang#116909

`@rustbot` label +F-f16_and_f128 +T-libs-api
bors added a commit to rust-lang-ci/rust that referenced this pull request May 16, 2024
Re-add `From<f16> for f64`

This impl was originally added in rust-lang#122470 before being removed in rust-lang#123830 due to rust-lang#123831. However, the issue only affects `f32` (which currently only has one `From<{float}>` impl, `From<f32>`) as `f64` already has two `From<{float}>` impls (`From<f32>` and `From<f64>`) and is also the float literal fallback type anyway. Therefore it is safe to re-add `From<f16> for f64`.

This PR also updates the FIXME link to point to the open issue rust-lang#123831 rather than the closed issue rust-lang#123824.

Tracking issue: rust-lang#116909

`@rustbot` label +F-f16_and_f128 +T-libs-api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type inference failure for f32
4 participants