Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix std::fs::copy on WASI target #69106

Merged
merged 1 commit into from
Feb 15, 2020
Merged

Commits on Feb 12, 2020

  1. 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 rust-lang#68560.
    RReverser committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    8fb8bb4 View commit details
    Browse the repository at this point in the history