]> git.lizzy.rs Git - rust.git/commit
Auto merge of #79473 - m-ou-se:clamp-in-core, r=m-ou-se
authorbors <bors@rust-lang.org>
Sat, 19 Dec 2020 21:57:38 +0000 (21:57 +0000)
committerbors <bors@rust-lang.org>
Sat, 19 Dec 2020 21:57:38 +0000 (21:57 +0000)
commitc1d58436614ad522e4db9113ac56d90ec4a95448
treea68f989c8df3bf269f2e85aa485dd80d94426d04
parent1f5bc176b0e54a8e464704adcd7e571700207fe9
parent0523eeb8a38dbd6e6e6fd9283b27609fbf38859c
Auto merge of #79473 - m-ou-se:clamp-in-core, r=m-ou-se

Move {f32,f64}::clamp to core.

`clamp` was recently stabilized (tracking issue: https://github.com/rust-lang/rust/issues/44095). But although `Ord::clamp` was added in `core` (because `Ord` is in `core`), the versions for the `f32` and `f64` primitives were added in `std` (together with `floor`, `sin`, etc.), not in `core` (together with `min`, `max`, `from_bits`, etc.).

This change moves them to `core`, such that `clamp` on floats is available in `no_std` programs as well.
library/std/src/f32.rs
library/std/src/f64.rs