uom icon indicating copy to clipboard operation
uom copied to clipboard

Implement f{32|64}::clamp

Open iliekturtles opened this issue 3 years ago • 8 comments

Stable in 1.50.0. How should support for the MSRV be done? Delay implementation?

https://blog.rust-lang.org/2021/02/11/Rust-1.50.0.html

iliekturtles avatar Feb 11 '21 19:02 iliekturtles

An alternative would be to detect the rustc version via build.rs and conditionally compile the implementation.

adamreichold avatar Feb 11 '21 20:02 adamreichold

(uom already transitively depends on autocfg so this would be one way to do this without adding a new build dependency.)

adamreichold avatar Feb 12 '21 07:02 adamreichold

autocfg being a transitive dependency is a good point! I've been hesitant to add a build.rs because compile times are bad enough.

I am toying with the idea of putting off any MSRV changes like this and jumping straight to 1.51 and min_const_generics. I haven't really done much work on the conversion yet.

iliekturtles avatar Feb 12 '21 12:02 iliekturtles

I am toying with the idea of putting off any MSRV changes like this and jumping straight to 1.51 and min_const_generics. I haven't really done much work on the conversion yet.

I am not sure that min_const_generics will be a significant change for uom as it does not include computation based on const type parameters which is sort of the point of compile time dimensional analysis, c.f. https://github.com/iliekturtles/uom/issues/134#issuecomment-751518357

adamreichold avatar Feb 12 '21 15:02 adamreichold

Looking at the proof of concept again I see that it does require much more than just min_const_generics: #![feature(const_generics, const_evaluatable_checked, doc_cfg)].

iliekturtles avatar Feb 15 '21 19:02 iliekturtles

Exactly, at a minimum it needs the full const_generics feature as it does computation based on const type parameters.

adamreichold avatar Feb 15 '21 19:02 adamreichold

As mentioned in #376 I'm inclined to raise the MSRV at this point. 1.43.0 is from April 23, 2020. 1.50.0 is from February 11, 2021.

iliekturtles avatar Sep 22 '22 15:09 iliekturtles

MSRV bumped to 1.60.0 in #422. I haven't started looking at this issue yet.

iliekturtles avatar Jun 27 '23 18:06 iliekturtles