Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct macros to generate valid 2015/2018 edition code. #120

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

iliekturtles
Copy link
Owner

Doc test on the $quantities! macro would fail with the error no ``mks`` external crate when the system! macro was invoked in a crate
using the 2018 edition. All invocations of the $quantities! macro are
corrected and a new test crate, edition_check, is added to validate
uom can be used in 2018 edition code. Resolves #119.

@svartalf if you could review that would be great.

@iliekturtles
Copy link
Owner Author

I ended up asking for a review too soon. I forgot that older versions don't support crate in paths. Trying to find a solution that supports old rustc versions.

@coveralls
Copy link

coveralls commented Mar 26, 2019

Coverage Status

Coverage remained the same at 97.077% when pulling c3898b8 on dev-2018 into 54cc327 on master.

Doc test on the `$quantities!` macro would fail with the error `no
``mks`` external crate` when the `system!` macro was invoked in a crate
using the 2018 edition. All invocations of the `$quantities!` macro are
corrected and a new test crate, `edition_check`, is added to validate
`uom` can be used in 2018 edition code. Resolves #119.
@iliekturtles
Copy link
Owner Author

@svartalf Ready for a review in my dev-2018 branch if you have some time. I'll try to merge in the next few days and push out another version to crates.io after that.

@svartalf
Copy link
Contributor

@iliekturtles what minimal rust version will be required by the "next" uom version?

If you're going to stick with 1.24 (same as now), I guess that your changes is the best option, since both crate and $crate are available only in >=1.30

I've tested this branch with my #119 code also, works flawlessly :)

@iliekturtles iliekturtles merged commit fb5d511 into master Mar 27, 2019
@iliekturtles iliekturtles deleted the dev-2018 branch March 27, 2019 22:36
@iliekturtles
Copy link
Owner Author

I plan to keep supporting 1.22.0 for compiling uom and 1.24.1 for full support for the foreseeable future. I didn't consider this requirement a big enough justification for a bump in the required version since there is an easy (although ugly) work-around.

Eventually the requirement will get bumped up. I'm doing some experimentation with proc-macros and how quantities track their units in the dev-macros branch (very rough still). I'm contemplating calling the current uom 1.0 and if that branch works out releasing it as 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants