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

as_num-0.2.2 beta regression #43657

Closed
est31 opened this issue Aug 5, 2017 · 4 comments
Closed

as_num-0.2.2 beta regression #43657

est31 opened this issue Aug 5, 2017 · 4 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@est31
Copy link
Member

est31 commented Aug 5, 2017

as_num version 0.2.2 regressed from stable to beta (full log):

    Compiling as_num v0.2.2 (file:///source)
 error[E0034]: multiple applicable items in scope
    --> src/lib.rs:241:50
     |
 152 | |                     $dest::min() <= n && n <= $dest::max()
     | |______________________________^ multiple `min` found
 ...
 241 |           impl_signed_to_signed_internal!($signed, $signed);
     |  __________________________________________________^

cc @phimuemue

@phimuemue
Copy link
Contributor

phimuemue commented Aug 5, 2017

I have no experience with this. Do I have to adapt my implementation to help rust finding the appropriate min?

@arielb1 arielb1 added regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 5, 2017
@arielb1
Copy link
Contributor

arielb1 commented Aug 5, 2017

@phimuemue

We added Ord::min (and Ord::max) functions. This broke your code because Rust can't tell whether you want to use its Ord::min or your SignedInt::min. This is unfortunate, but we haven't discovered another way to add functions to the Rust library.

You can do a local work-around by calling <$dest as SignedInt>::min (or <$dest as UnsignedInt>::min), or fix this by renaming your function to something else.

@phimuemue
Copy link
Contributor

I (think I) solved the problem using the <$dest as SignedInt> variant, so I think you can close this issue.

@est31
Copy link
Member Author

est31 commented Aug 5, 2017

@phimuemue thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants