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

Fix #682 #686

Merged
merged 10 commits into from Jan 8, 2019
Merged

Fix #682 #686

merged 10 commits into from Jan 8, 2019

Conversation

dhardy
Copy link
Member

@dhardy dhardy commented Jan 8, 2019

No description provided.

@dhardy
Copy link
Member Author

dhardy commented Jan 8, 2019

I also included the switch to run-time failure for WASM, as mentioned in #678 and #681.

@newpavlov would you please review?

@vks
Copy link
Collaborator

vks commented Jan 8, 2019

This adds a new default feature, so this is a breaking change. This warrants increasing the Rand version to 0.7.

@dhardy
Copy link
Member Author

dhardy commented Jan 8, 2019

Why is that a breaking change? Besides, this was added in 0.6.2; this is just documenting it better.

BTW I had to push yet another fix to the changelog and prepare the next rand_os release (perhaps a new PR would have been better)

@vks
Copy link
Collaborator

vks commented Jan 8, 2019

@dhardy Adding a new default feature that gates existing functionality breaks builds with --no-default-features (see rust-num/num#297).

@dhardy
Copy link
Member Author

dhardy commented Jan 8, 2019

I don't believe this is a problem since it is implied by std and the functionality was already feature-gated behind std.

It's actually pointless as a feature flag since it is only usable exactly when std is usable, but Cargo makes all optional dependencies into "features", hence I thought we should document it.

@vks
Copy link
Collaborator

vks commented Jan 8, 2019

I don't believe this is a problem since it is implied by std and the functionality was already feature-gated behind std.

I think you are right, this should be no problem.

@newpavlov
Copy link
Member

As a patch for v0.6 WASM issues looks good to me! Though I still strongly believe that rand_os should use compile-time errors instead of the runtime ones. I guess we can discuss it in a separate issue.

#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
#[doc(hidden)]
#[allow(missing_debug_implementations)]
pub mod __wbg_shims {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this module have to be public? Can't it be pub(crate)?

Copy link
Member Author

@dhardy dhardy Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. The module isn't required at all for building and we don't have a running test-suite. However it's not referenced within the crate, so I don't think pub(crate) is appropriate.

@dhardy
Copy link
Member Author

dhardy commented Jan 8, 2019

Though I still strongly believe that rand_os should use compile-time errors instead of the runtime ones.

Ideally, yes, but in this that appears to be difficult, and likely not worth the effort of figuring out the problems other people have as a result.

@dhardy dhardy merged commit 4336232 into rust-random:master Jan 8, 2019
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.

None yet

3 participants