about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-20 20:57:27 +0200
committerGitHub <noreply@github.com>2025-05-20 20:57:27 +0200
commit8e1ce2059d8351e7a8d88d0898459b8263901ea7 (patch)
treed4970868d987522e97380a1fbfedce8a9806824e /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent221d6c734c152b10746e690926bf9210f67be81c (diff)
parentf6709bb6834818193efce3315f107744982d2d43 (diff)
downloadrust-8e1ce2059d8351e7a8d88d0898459b8263901ea7.tar.gz
rust-8e1ce2059d8351e7a8d88d0898459b8263901ea7.zip
Rollup merge of #141282 - DJMcNab:core-float-math-math, r=tgross35
`core_float_math`: Move functions to `math` module

When these functions were added in https://github.com/rust-lang/rust/pull/138087 It made a relatively common pattern for emulating these functions using an extension trait (which internally uses `libm`) much more fragile. If `core::f32` happened to be imported by the user (to access a constant, say), then that import in the module namespace would take precedence over the `f32` in the type namespace for resolving these functions, running headfirst into the stability attribute.

We ran into this in [Color](https://github.com/linebender/color) and chose to release the remedial 0.3.1 and 0.2.4, to allow downstream crates to build on `docs.rs`.

As these methods are perma-unstable, moving them into a new module should not have any long-term concerns, and ensures that this "breakage" doesn't adversely impact anyone else.

I believe that I've made the module unstable correctly. I presume that this does not require a test to make sure stable code can't depend on the module existing?

I've left the stability attribute on each function - happy to tweak this if a different pattern is more correct.

Tracking issue for `core_float_math`: https://github.com/rust-lang/rust/issues/137578.
This PR is as requested in https://github.com/rust-lang/rust/pull/138087.

r? `@tgross35`

Recommended reviewing with whitespace hidden.

(This is my first PR to `std/core`/this repository, as far as I can remember)
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions