Skip to content

Fix #682 - #686

Merged
dhardy merged 10 commits into
rust-random:masterfrom
dhardy:master
Jan 8, 2019
Merged

dhardy merged 10 commits into
rust-random:masterfrom
dhardy:master

Conversation

@dhardy

@dhardy dhardy commented Jan 8, 2019

Copy link
Copy Markdown
Member

No description provided.

@dhardy

dhardy commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

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

@newpavlov would you please review?

@vks

vks commented Jan 8, 2019

Copy link
Copy Markdown
Contributor

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

@dhardy

dhardy commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

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

vks commented Jan 8, 2019

Copy link
Copy Markdown
Contributor

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

@dhardy

dhardy commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

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

vks commented Jan 8, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread rand_os/src/lib.rs
#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
#[doc(hidden)]
#[allow(missing_debug_implementations)]
pub mod __wbg_shims {

Copy link
Copy Markdown
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)?

@dhardy dhardy Jan 8, 2019 •

Copy link
Copy Markdown
Member Author

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

dhardy commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

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.

3 participants