You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...then the entire problem just goes away without having to add an explicit ?Sized bound on the blanket impl?
Edit: aah nope, I think it still needs this change as well to be able to work with trait objects, and we still need a TryCryptoRng bound for CryptoRng, but with this change it's possible to add an explicit RngCore bound to CryptoRng, like:
@baloo yeah, we use <R: CryptoRng + ?Sized> in several places, so it's going to be really annoying (and ideally not necessary) to change all of those to add a RngCore bound
@dhardy I don't suppose it would be possible to get another prerelease out with this PR (and possibly with the added CryptoRng: RngCore bound)? It's going to be annoying to update to v0.10.0-rc-4 as-is
The reason will be displayed to describe this comment to others. Learn more.
I think having explicit bounds even if they're covered by a blanket impl makes the compiler errors much better, because it will tell you explicitly why the bound wasn't satisfied, whereas figuring out why a blanket impl didn't work can be a lot of red herrings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
?Sizedto the bounds of the blanket impls, so unsized types can also be used by way of the blanket impl.See also: #45