rust/src/tools
bors 5a4ab26459 Auto merge of #78880 - CDirkx:not_supported, r=joshtriplett
Add `Unsupported` to `std::io::ErrorKind`

I noticed a significant portion of the uses of `ErrorKind::Other` in std is for unsupported operations.
The notion that a specific operation is not available on a target (and will thus never succeed) seems semantically distinct enough from just "an unspecified error occurred", which is why I am proposing to add the variant `Unsupported` to `std::io::ErrorKind`.

**Implementation**:

The following variant will be added to `std::io::ErrorKind`:

```rust
/// This operation is unsupported on this platform.
Unsupported
```
`std::io::ErrorKind::Unsupported` is an error returned when a given operation is not supported on a platform, and will thus never succeed; there is no way for the software to recover. It will be used instead of `Other` where appropriate, e.g. on wasm for file and network operations.

`decode_error_kind` will be updated  to decode operating system errors to `Unsupported`:
- Unix and VxWorks: `libc::ENOSYS`
- Windows: `c::ERROR_CALL_NOT_IMPLEMENTED`
- WASI: `wasi::ERRNO_NOSYS`

**Stability**:
This changes the kind of error returned by some functions on some platforms, which I think is not covered by the stability guarantees of the std? User code could depend on this behavior, expecting `ErrorKind::Other`, however the docs already mention:

> Errors that are `Other` now may move to a different or a new `ErrorKind` variant in the future. It is not recommended to match an error against `Other` and to expect any additional characteristics, e.g., a specific `Error::raw_os_error` return value.

The most recent variant added to `ErrorKind` was `UnexpectedEof` in `1.6.0` (almost 5 years ago), but `ErrorKind` is marked as `#[non_exhaustive]` and the docs warn about exhaustively matching on it, so adding a new variant per se should not be a breaking change.

The variant `Unsupported` itself could be marked as `#[unstable]`, however, because this PR also immediately uses this new variant and changes the errors returned by functions I'm inclined to agree with the others in this thread that the variant should be insta-stabilized.
2021-04-18 20:03:54 +00:00
..
build-manifest Remove the x86_64-rumprun-netbsd target 2021-02-27 17:55:22 +02:00
cargo@65d57e6f38 Update cargo 2021-04-05 17:10:04 -07:00
cargotest Auto merge of #81507 - weiznich:add_diesel_to_cargo_test, r=Mark-Simulacrum 2021-04-03 20:48:25 +00:00
clippy Auto merge of #78880 - CDirkx:not_supported, r=joshtriplett 2021-04-18 20:03:54 +00:00
compiletest Error when compiletest is passed duplicate revisions 2021-04-16 17:05:59 -04:00
error_index_generator mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
expand-yaml-anchors Tell user how to fix CI file being not up to date 2021-02-11 19:57:59 -05:00
jsondocck Better errors in jsondocck 2021-03-24 16:54:12 +00:00
linkchecker Bump cfgs 2021-04-04 14:57:05 -04:00
lint-docs lint-docs: Warn on missing lint when documenting. 2020-12-26 13:48:09 -08:00
miri@a86eab3e6c Update miri. 2021-04-17 02:22:13 +08:00
remote-test-client Update armhf-gnu to Ubuntu 20.04 2021-01-30 00:33:02 +01:00
remote-test-server Preserve existing LD_LIBRARY_PATH in remote-test-server 2021-01-27 23:08:15 +00:00
rls@32c0fe006d update RLS and rustfmt 2021-04-12 09:01:17 -05:00
rust-analyzer@7be06139b6 ⬆️ rust-analyzer 2021-04-14 21:25:43 +03:00
rust-demangler Address review comments and Windows failure, and make cleaner 2021-04-03 18:03:50 -07:00
rust-installer@5254dbfd25 bump rust-installer submodule 2020-12-28 12:48:11 +01:00
rustbook Update mdbook 2021-01-14 17:50:23 -08:00
rustc-workspace-hack bumped smallvec deps 2021-02-14 18:03:11 +03:00
rustdoc use jemallocator in rustc/rustdoc 2021-04-04 14:10:26 -07:00
rustdoc-gui Add new rustdoc-gui test suite 2021-02-21 14:21:04 +01:00
rustdoc-js Updated tester.js for separate search.js 2021-04-13 16:43:14 -07:00
rustdoc-themes Format the world 2019-12-22 17:42:47 -05:00
rustfmt@0bd2b1927c update RLS and rustfmt 2021-04-12 09:01:17 -05:00
tidy Auto merge of #84065 - c410-f3r:tests-tests-tests, r=petrochenkov 2021-04-18 04:53:18 +00:00
tier-check Remove note about missing ios/tvos targets in platform docs. 2020-09-25 12:09:06 -07:00
unicode-table-generator unicode_table_generator: fix clippy::writeln_empty_string, clippy::useless_format, clippy:::for_kv_map 2020-08-24 00:43:50 +02:00
unstable-book-gen Replace write_fmt with write! 2020-09-20 10:35:23 +02:00
x Add installation commands to x tool README 2020-12-21 17:18:48 -08:00
publish_toolstate.py Fix some Python2->3 error in publish_toolstate.py by type-checking it 2021-02-20 18:48:22 -05:00