Skip to content

Commit deac126

Browse files
committed
Remove dummy implementation (#107)
Removes the “dummy” feature and “wasm32-unknown-unknown” dummy impl
1 parent e9a75ea commit deac126

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ wasm-bindgen-test = "0.2"
3737

3838
[features]
3939
std = []
40-
# Enables dummy implementation for unsupported targets
41-
dummy = []
4240
# Unstable feature to support being a libstd dependency
4341
rustc-dep-of-std = ["compiler_builtins", "core"]
4442
# Unstable feature for testing

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ a compilation error. If you want to build an application which uses `getrandom`
5858
for such target, you can either:
5959
- Use [`[replace]`][replace] or [`[patch]`][patch] section in your `Cargo.toml`
6060
to switch to a custom implementation with a support of your target.
61-
- Enable the `dummy` feature to have getrandom use an implementation that always
62-
fails at run-time on unsupported targets.
6361

6462
[replace]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-replace-section
6563
[patch]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section

src/dummy.rs

-14
This file was deleted.

src/lib.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
//! for such target, you can either:
4444
//! - Use [`[replace]`][replace] or [`[patch]`][patch] section in your `Cargo.toml`
4545
//! to switch to a custom implementation with a support of your target.
46-
//! - Enable the `dummy` feature to have getrandom use an implementation that always
47-
//! fails at run-time on unsupported targets.
4846
//!
4947
//! [replace]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-replace-section
5048
//! [patch]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section
@@ -239,13 +237,12 @@ cfg_if! {
239237
} else if #[cfg(feature = "stdweb")] {
240238
#[path = "wasm32_stdweb.rs"] mod imp;
241239
} else {
242-
// Always have an implementation for wasm32-unknown-unknown.
243-
// See https://github.com/rust-random/getrandom/issues/87
244-
#[path = "dummy.rs"] mod imp;
240+
compile_error!("\
241+
Enable crate features to use the wasm32-unknown-unknown target, see: \
242+
https://docs.rs/getrandom/#support-for-webassembly-and-asmjs\
243+
");
245244
}
246245
}
247-
} else if #[cfg(feature = "dummy")] {
248-
#[path = "dummy.rs"] mod imp;
249246
} else {
250247
compile_error!("\
251248
target is not supported, for more information see: \

0 commit comments

Comments
 (0)