Skip to content

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

Closed as not planned

Description

@BoxyUwU
[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]     |    

Activity

  1. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on May 17, 2024
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on May 17, 2024
  3. compiler-errors commented on May 17, 2024

    @compiler-errors
    Contributor

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

  4. added this to the 1.79.0 milestone on May 17, 2024
  5. tgross35 commented on May 17, 2024

    @tgross35
    Member

    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

  6. zachs18 commented on May 17, 2024

    @zachs18
    Contributor

    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

  7. tgross35 commented on May 17, 2024

    @tgross35
    Member

    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.

  8. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on May 18, 2024
  9. apiraino commented on May 21, 2024

    @apiraino
    Contributor

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

  10. tgross35 commented on May 21, 2024

    @tgross35
    Member

    @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.

  11. apiraino commented on May 28, 2024

    @apiraino
    Contributor

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

    @rustbot label T-libs

  12. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    on May 28, 2024
  13. added a commit that references this issue on Jun 5, 2024
  14. 1 remaining item

  15. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 5, 2024
  16. added
    relnotesMarks issues that should be documented in the release notes of the next release.
    on Jul 10, 2024
  17. removed
    relnotesMarks issues that should be documented in the release notes of the next release.
    on Jul 10, 2024
  18. apiraino commented on Aug 5, 2024

    @apiraino
    Contributor

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

  19. tgross35 commented on Aug 5, 2024

    @tgross35
    Member

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

  20. added
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    and removed on Oct 11, 2024
  21. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 11, 2024
  22. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 11, 2024
  23. apiraino commented on Oct 15, 2024

    @apiraino
    Contributor

    Closing since regression is mentioned in the release notes

  24. added a commit that references this issue on Mar 11, 2025
  25. added a commit that references this issue on Mar 16, 2025
  26. added a commit that references this issue on Mar 17, 2025
  27. added a commit that references this issue on Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions