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

regression: can't call method abs on ambiguous numeric type {float} #125198

Closed
BoxyUwU opened this issue May 17, 2024 · 11 comments
Closed

regression: can't call method abs on ambiguous numeric type {float} #125198

BoxyUwU opened this issue May 17, 2024 · 11 comments
Labels
regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Milestone

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented May 17, 2024

[INFO] [stdout] error[E0689]: can't call method `abs` on ambiguous numeric type `{float}`
[INFO] [stdout]    --> src/activation.rs:206:39
[INFO] [stdout]     |
[INFO] [stdout] 206 |         assert!((res[0] - 0.08192506).abs() < 0.001);
[INFO] [stdout]     |    
@BoxyUwU BoxyUwU added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels May 17, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 17, 2024
@compiler-errors
Copy link
Member

This was probably regressed w/ some f16/f128 stuff cc @tgross35

@BoxyUwU BoxyUwU added this to the 1.79.0 milestone May 17, 2024
@tgross35
Copy link
Contributor

tgross35 commented May 17, 2024

Hm, when did this last work? I can't get it to compile successfully even on older versions https://rust.godbolt.org/z/ExcMY36bf

edit: slightly more like the published test in https://docs.rs/crate/puffpastry/0.1.0/source/src/activation.rs, same results https://rust.godbolt.org/z/crWhqYq6h

@zachs18
Copy link
Contributor

zachs18 commented May 17, 2024

The puffpastry crate's bound includes T: ValidNumber<T>, which includes T: ... + From<f64> + .... Adding T: Copy + From<f64> to the example makes it compile on stable https://rust.godbolt.org/z/EbKTjzM9v

@tgross35
Copy link
Contributor

Ah, then #123830 also should have removed this line https://github.com/rust-lang/rust/pull/123830/files#diff-154dff23a2c2f4fb97915229fd9c27d73293940250088020bfd2074094186ce4L173, which was added in #122470.

Was this crate the only regression of this kind? If that is the case, maybe we would be okay leaving it based on discussion at #123831.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 18, 2024
@apiraino
Copy link
Contributor

apiraino commented May 21, 2024

@tgross35 should the changes in #123830 / #123831 #124728 be in relnotes? I'm thinking if there are changes here useful to be announced. Thanks

@tgross35
Copy link
Contributor

@apiraino I think the only things maybe relevant for release notes would be conversions that involve a stable type, which could have an effect on inference. These would be:

  1. From<f16> for f64 added in f16 and f128 step 4: basic library support #122470, removed in Roll std::run into std::io::process #12380, added back in Remove std::bool::{Bool, all_values} #12473 (1.80 current nightly). Already had a crater run, no regressions
  2. From<f32> for f128, added in f16 and f128 step 4: basic library support #122470 (1.79 current beta). No known regressions
  3. From<f64> for f128, added in f16 and f128 step 4: basic library support #122470 (1.79 current beta). Regressions

Item 3 is the subject of this issue, we'll need a decision about whether to accept the regression or remove the impl.

The remaining conversions from #122470 shouldn't affect anything without nightly so I don't think they need release notes.

@apiraino
Copy link
Contributor

probably adding t-libs then. Opened a topic for increased visibility on Zulip

@rustbot label T-libs

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 28, 2024
tgross35 added a commit to tgross35/puffpastry that referenced this issue Jun 5, 2024
This bit of code relies on behavior that will no longer work in Rust 1.79,
which is currently in beta. Since this crate was the only regression, the
behavior change was considered acceptable, but does mean that this crate has a
minor breakage in tests. 

Add a concrete type to the vector to correct for this behavior change. 

See the context here:
rust-lang/rust#125198
@tgross35
Copy link
Contributor

tgross35 commented Jun 5, 2024

Per https://rust-lang.zulipchat.com/#narrow/stream/259402-t-libs.2Fmeetings/topic/Meeting.202024-05-29/near/441273130, this regression is accepted. I submitted a PR to the regressed crate here uek-1/puffpastry#4

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 5, 2024
@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 10, 2024
@Amanieu Amanieu removed the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 10, 2024
@apiraino
Copy link
Contributor

apiraino commented Aug 5, 2024

I think this can be now closed as accepted, correct? cc @BoxyUwU

@tgross35
Copy link
Contributor

tgross35 commented Aug 5, 2024

(I feel like we should have something like a regression-accepted label to make the status of these issues clear)

@Mark-Simulacrum Mark-Simulacrum added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Oct 11, 2024
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 11, 2024
@tgross35 tgross35 removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 11, 2024
@apiraino
Copy link
Contributor

Closing since regression is mentioned in the release notes

@apiraino apiraino closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants