diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2019-07-23 07:25:34 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2019-08-28 08:34:31 -0700 |
| commit | 8fe65da935d7e01dbac897dcfbb4fb0f9f24e442 (patch) | |
| tree | b254c7ebfb19010383348d31d31b83e85445d644 /src/libstd/sys/wasm/stdio.rs | |
| parent | ac21131f7859836cd3fcb39231c0162fd892d960 (diff) | |
| download | rust-8fe65da935d7e01dbac897dcfbb4fb0f9f24e442.tar.gz rust-8fe65da935d7e01dbac897dcfbb4fb0f9f24e442.zip | |
std: Remove the `wasm_syscall` feature
This commit removes the `wasm_syscall` feature from the wasm32-unknown-unknown build of the standard library. This feature was originally intended to allow an opt-in way to interact with the operating system in a posix-like way but it was never stabilized. Nowadays with the advent of the `wasm32-wasi` target that should entirely replace the intentions of the `wasm_syscall` feature.
Diffstat (limited to 'src/libstd/sys/wasm/stdio.rs')
| -rw-r--r-- | src/libstd/sys/wasm/stdio.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/libstd/sys/wasm/stdio.rs b/src/libstd/sys/wasm/stdio.rs index b8899a9c847..5a4e4505e93 100644 --- a/src/libstd/sys/wasm/stdio.rs +++ b/src/libstd/sys/wasm/stdio.rs @@ -1,5 +1,4 @@ use crate::io; -use crate::sys::{ReadSysCall, WriteSysCall}; pub struct Stdin; pub struct Stdout; @@ -12,8 +11,8 @@ impl Stdin { } impl io::Read for Stdin { - fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { - Ok(ReadSysCall::perform(0, buf)) + fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> { + Ok(0) } } @@ -25,7 +24,6 @@ impl Stdout { impl io::Write for Stdout { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { - WriteSysCall::perform(1, buf); Ok(buf.len()) } @@ -42,7 +40,6 @@ impl Stderr { impl io::Write for Stderr { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { - WriteSysCall::perform(2, buf); Ok(buf.len()) } @@ -57,10 +54,6 @@ pub fn is_ebadf(_err: &io::Error) -> bool { true } -pub fn panic_output() -> Option<impl io::Write> { - if cfg!(feature = "wasm_syscall") { - Stderr::new().ok() - } else { - None - } +pub fn panic_output() -> Option<Vec<u8>> { + None } |
