-
Notifications
You must be signed in to change notification settings - Fork 84
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
Update to rand >= 0.8 #133
Comments
I don't think this can happen. There are some crates for which you can only link to one version, but |
I noticed this behavior when trying to do the update myself. I altered statrs to properly use rand 0.8 (changes were minimal), but then the nalgebra dependency pulled in rand 0.7. This confused the compiler abour the definition of the |
This sounds like a legitimate type mismatch. |
That may very well be the case. I found the compiler message to be a bit cryptic, even though it was clever enough to suggest
In particular, the |
Yes, unfortunately the compiler messages can be very confusing in such cases! This is an old issue, see rust-lang/rust#22750. The compiler does not now about crate versions (that's a concept only cargo knows about), so for the compiler it looks like you are mixing two different types from possibly completely unrelated crates. What makes it even more confusing, is that the compiler usually shortens the types (to make the error message more readable), but in such cases this can result in messages like "Expected |
Oh wow; that is confusing. Anyway, thanks for the details, the pointer, and the PR! |
Currently,
statrs
relies onrand
0.7 andnalgebra
0.23 (which itself relies onrand
0.7). The newer releases ofnalgebra
update their dependency to the latestrand
, which is currently 0.8.3. One of the minor, but frustrating, differences between 0.7 and 0.8 is a change in the syntax of therand_range
function, from taking 2 arguments to taking a single range argument.It would be great if
statrs
could be updated to rely on a newernalgebra
and a newerstatrs
. Currently, if one is depending onrand
>= 0.8 (or is depending on any package that depends on this), then multiple different versions ofrand
are pulled down. Not only does this bloat the build, but it can run the risk of confusing the compiler about definitions that appear in both versions of the package.The actual changes to conform with the new API interface of
rnd_range
are small, but I think there are some other changes that would need to be made, since the version ofnalgebra
should be bumped (but perhaps not to the very latest (0.26.1), unless other changes are made because they have deprecated some interfaces that are currently used instatrs
).The text was updated successfully, but these errors were encountered: