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

move to typenum #3

Closed llogiq closed 8 years ago

llogiq commented 8 years ago

This still has the following error, but it's getting late:

note: conflicting implementation in crate `typenum`
src/make_units.rs:149:9: 156:10 error: conflicting implementations for trait `typenum::Same` [E0119]
src/make_units.rs:149         impl<$($Type),*, $($constant),*> Same<$System<$($constant),*>> for $System<$($Type),*>
src/make_units.rs:150             where $($Type: Integer + Same<$constant>),*,
src/make_units.rs:151                   $($constant: Integer),*,
src/make_units.rs:152                   $(<$Type as Same<$constant>>::Output: Integer),*,
src/make_units.rs:153                   $System<$(<$Type as Same<$constant>>::Output),*>: Dimension,
src/make_units.rs:154         {
                      ...
src/cgs.rs:10:1: 19:2 note: in this expansion of make_units_adv! (defined in src/make_units.rs)
src/make_units.rs:149:9: 156:10 help: run `rustc --explain E0119` to see a detailed explanation
paholg commented 8 years ago

typenum implements Same for all types now (yay doing things generically), so it doesn't need to be implemented in the make_units macro anymore.

llogiq commented 8 years ago

Related to typenum #42, we may need Copy implemented on Integers for this to work.

llogiq commented 8 years ago

I'll need to look at how you fixed that when I find some time.

paholg commented 8 years ago

I just manually implemented copy and clone instead of deriving them. Using #derive would be more elegant, though.

llogiq commented 8 years ago

Ok, we may want to move this to typenum later. Cool!

llogiq commented 8 years ago

A version bump is needed, because this is a breaking change! We should also document this change for our users. Perhaps some blog entry? Or do we add a CHANGELOG?

brendanzab commented 8 years ago

Changelogs! https://blog.dbrgn.ch/2015/12/1/rust-crates-keep-a-changelog/ :3

paholg commented 8 years ago

@bjz changelog added!

llogiq commented 8 years ago

Great timing :smile:

paholg commented 8 years ago

I guess I don't need to answer your question on the fork. :stuck_out_tongue:

llogiq commented 8 years ago

You already did. :smile: