Skip to content

Commit

Permalink
Remove dummy implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
josephlr committed Sep 21, 2019
1 parent 05b479a commit f2cf861
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ wasm-bindgen-test = "0.2"

[features]
std = []
# Enables dummy implementation for unsupported targets
dummy = []
# Unstable feature to support being a libstd dependency
rustc-dep-of-std = ["compiler_builtins", "core"]
# Unstable feature for testing
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ a compilation error. If you want to build an application which uses `getrandom`
for such target, you can either:
- Use [`[replace]`][replace] or [`[patch]`][patch] section in your `Cargo.toml`
to switch to a custom implementation with a support of your target.
- Enable the `dummy` feature to have getrandom use an implementation that always
fails at run-time on unsupported targets.

[replace]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-replace-section
[patch]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section
Expand Down
14 changes: 0 additions & 14 deletions src/dummy.rs

This file was deleted.

11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
//! for such target, you can either:
//! - Use [`[replace]`][replace] or [`[patch]`][patch] section in your `Cargo.toml`
//! to switch to a custom implementation with a support of your target.
//! - Enable the `dummy` feature to have getrandom use an implementation that always
//! fails at run-time on unsupported targets.
//!
//! [replace]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-replace-section
//! [patch]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section
Expand Down Expand Up @@ -239,13 +237,12 @@ cfg_if! {
} else if #[cfg(feature = "stdweb")] {
#[path = "wasm32_stdweb.rs"] mod imp;
} else {
// Always have an implementation for wasm32-unknown-unknown.
// See https://github.com/rust-random/getrandom/issues/87
#[path = "dummy.rs"] mod imp;
compile_error!("\
Enable crate features to use the wasm32-unknown-unknown target, see: \
https://docs.rs/getrandom/#support-for-webassembly-and-asmjs\
");
}
}
} else if #[cfg(feature = "dummy")] {
#[path = "dummy.rs"] mod imp;
} else {
compile_error!("\
target is not supported, for more information see: \
Expand Down

0 comments on commit f2cf861

Please sign in to comment.