-
Notifications
You must be signed in to change notification settings - Fork 192
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
Stop using dummy implementation #49
Comments
Your code example is wrong though; we need to call |
I think our current plan in rust-lang/rust#62082 was to have |
I am on the fence regarding this. Initially in |
Vaguely, yes. See rust-random/rand#508 which took us from "compile errors on unsupported platforms" to "less features on unsupported platforms"... but having those big |
So it looks like currently the rest of the
Then, we would not need a bunch of
|
There is one other option that has been suggested: use |
I believe it will not be a correct approach. Ideally we should not support |
I think that for now opt-in feature support is the best that we can do. It's not great, but it reflects the intentions of the targets which is that For the standard library this is somewhat moot though since it can't depend on |
How about adding a disabled by default We also can add a |
Inspired by @dhardy's comment rust-lang/rust#62082 (comment)
This would simply remove the dummy implementation, causing a compiler error on unsupported platforms. This makes it much easier to detect platform support issues (as a compiler error is permeable to a run time error). This would also make it clear that when porting
libstd
orrand
to a different platform, an implementation ingetrandom
is needed.For example, @newpavlov's code in rust-lang/rust#62082 would be changed to:
Note that this would be a breaking change, so it would require
0.2
The text was updated successfully, but these errors were encountered: