about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/mod.rs
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2021-08-13 08:58:05 -0700
committerDan Gohman <dev@sunfishcode.online>2021-08-13 09:10:22 -0700
commit35de5c9b35be9feef992c3d03ed95a7176a15726 (patch)
tree2521b50cac44f444eefdabaa2b27e7383e851706 /compiler/rustc_mir_transform/src/coverage/mod.rs
parent8df945c4717ffaf923b57bf30c473df6fc98bc85 (diff)
downloadrust-35de5c9b35be9feef992c3d03ed95a7176a15726.tar.gz
rust-35de5c9b35be9feef992c3d03ed95a7176a15726.zip
Change WASI's `RawFd` from `u32` to `c_int` (`i32`).
WASI previously used `u32` as its `RawFd` type, since its "file descriptors"
are unsigned table indices, and there's no fundamental reason why WASI can't
have more than 2^31 handles.

However, this creates myriad little incompability problems with code
that also supports Unix platforms, where `RawFd` is `c_int`. While WASI
isn't a Unix, it often shares code with Unix, and this difference made
such shared code inconvenient. #87329 is the most recent example of such
code.

So, switch WASI to use `c_int`, which is `i32`. This will mean that code
intending to support WASI should ideally avoid assuming that negative file
descriptors are invalid, even though POSIX itself says that file descriptors
are never negative.

This is a breaking change, but `RawFd` is considerd an experimental
feature in [the documentation].

[the documentation]: https://doc.rust-lang.org/stable/std/os/wasi/io/type.RawFd.html
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions