paholg / dimensioned

Compile-time dimensional analysis for various unit systems using Rust's type system.
https://crates.io/crates/dimensioned
MIT License
300 stars 23 forks source link

Fix no-std of dependencies #38

Closed dbeckwith closed 6 years ago

dbeckwith commented 6 years ago

I was having trouble compiling 0.6.0 in a no_std environment, because the version of generic-array it depended on (which was very old) wasn't no_std. All I did in these changes is bump the version of generic-array the minimum I could to resolve this. a4a8fe2 then fixes the few breaking API changes. f76208c was necessary because the pow* and sqrt functions are part of std and didn't exist in the no_std environment, so I had to replace them with their counterparts in core::intrinsics. I made this a minor version bump because the API doesn't change at all.

dbeckwith commented 6 years ago

Hmm, well my changes worked for my situation, but I guess I made it nightly-only, and even on nightly I didn't catch all the std math functions. I can update it to fix nightly, but this might not be worth merging.

paholg commented 6 years ago

Hey, sorry I never responded to this. I would definitely like to get dimensioned working with no_std again (I didn't realize that I had broken it with generic-array) but not at the cost of making it nightly-only.

It looks like the current version of generic-array is 0.11.2; I wonder how hard it would be to upgrade to it.

paholg commented 6 years ago

@dbeckwith As of #49, this should be working without std. You do need nightly, but only for no_std, and to specify not to use default features.

Please let me know if there are any problems.