about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorIngvar Stepanyan <rreverser@google.com>2020-02-12 19:51:30 +0000
committerIngvar Stepanyan <rreverser@google.com>2020-02-12 20:08:41 +0000
commit8fb8bb4b3ff25570a7a9b105c1a569bb2307f25f (patch)
tree427fc7af832e04950ea32178f385776ced5bf8f8 /src/libstd/sys/unix/stack_overflow.rs
parent2d2be570970d784db5539a1d309cd22b85be910a (diff)
downloadrust-8fb8bb4b3ff25570a7a9b105c1a569bb2307f25f.tar.gz
rust-8fb8bb4b3ff25570a7a9b105c1a569bb2307f25f.zip
Fix std::fs::copy on WASI target
Previously `std::fs::copy` on wasm32-wasi would reuse code from the `sys_common` module and would successfully copy contents of the file just to fail right before closing it.

This was happening because `sys_common::copy` tries to copy permissions of the file, but permissions are not a thing in WASI (at least yet) and `set_permissions` is implemented as an unconditional runtime error.

This change instead adds a custom working implementation of `std::fs::copy` (like Rust already has on some other targets) that doesn't try to call `set_permissions` and is essentially a thin wrapper around `std::io::copy`.

Fixes #68560.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions