Add io::ErrorKind::TooManyOpenFiles#158326
Conversation
`EMFILE` and `ENFILE` decoded to `ErrorKind::Uncategorized`, so running out of file descriptors could only be detected through `raw_os_error()`. Map them, and the equivalent codes on Windows (`ERROR_TOO_MANY_OPEN_FILES`, `WSAEMFILE`) and VEXos (`FR_TOO_MANY_OPEN_FILES`), to a new unstable `TooManyOpenFiles` variant.
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
@bors r+ rollup PR CI failure is spurious |
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
…-files, r=jhpratt Add `io::ErrorKind::TooManyOpenFiles` Adds an unstable `io::ErrorKind::TooManyOpenFiles` for the open-file-limit condition. `EMFILE` and `ENFILE` currently decode to `ErrorKind::Uncategorized`, so stable code cannot tell that an operation failed because the process or the system ran out of file descriptors without inspecting `raw_os_error()` and a platform-specific `libc`/`windows-sys` constant. Implements the accepted ACP rust-lang/libs-team#818, including its decision to collapse `EMFILE` and `ENFILE` into a single variant. Finer-grained handling stays available through `raw_os_error()`. The variant maps: - `EMFILE` / `ENFILE` on Unix and WASI - `ERROR_TOO_MANY_OPEN_FILES` / `WSAEMFILE` on Windows - `FR_TOO_MANY_OPEN_FILES` on VEXos Tracking issue: rust-lang#158319 r? libs
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Rollup merge of #158326 - valentynkit:io-error-too-many-open-files, r=jhpratt Add `io::ErrorKind::TooManyOpenFiles` Adds an unstable `io::ErrorKind::TooManyOpenFiles` for the open-file-limit condition. `EMFILE` and `ENFILE` currently decode to `ErrorKind::Uncategorized`, so stable code cannot tell that an operation failed because the process or the system ran out of file descriptors without inspecting `raw_os_error()` and a platform-specific `libc`/`windows-sys` constant. Implements the accepted ACP rust-lang/libs-team#818, including its decision to collapse `EMFILE` and `ENFILE` into a single variant. Finer-grained handling stays available through `raw_os_error()`. The variant maps: - `EMFILE` / `ENFILE` on Unix and WASI - `ERROR_TOO_MANY_OPEN_FILES` / `WSAEMFILE` on Windows - `FR_TOO_MANY_OPEN_FILES` on VEXos Tracking issue: #158319 r? libs
|
@rust-timer build 125395d |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (125395d): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 4.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.6%, secondary 2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 503.101s -> 505.347s (0.45%) |
Rollup of 35 pull requests Successful merges: - rust-lang/rust#158315 (`rust-analyzer` subtree update) - rust-lang/rust#158336 (Stop excluding `stdarch` test crates from `rust-src`) - rust-lang/rust#155739 (Add temporary scope to assert_eq and assert_ne) - rust-lang/rust#156885 (Fix misattributed type inference error span for index expressions) - rust-lang/rust#157271 (simplify some `proc_macro` things) - rust-lang/rust#157419 (move rustc_type_ir Term things to term_kind.rs) - rust-lang/rust#157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - rust-lang/rust#157921 (trait solver: Resolve region vars in max universe) - rust-lang/rust#157960 (delegation: add support for infers in generics) - rust-lang/rust#157983 (Lift the same-signature restriction for `extern "tail"`) - rust-lang/rust#158053 (Optimize network address parser) - rust-lang/rust#158105 (Extract all instance shim variants into new `ShimKind` enum) - rust-lang/rust#158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - rust-lang/rust#158279 (Follow goto and drop when linting unreachable code) - rust-lang/rust#157527 (Move derive tests into their dedicated folder) - rust-lang/rust#157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - rust-lang/rust#157939 (Reorganize `tests/ui/issues` [8/N]) - rust-lang/rust#157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - rust-lang/rust#158003 (Reorganize `tests/ui/issues` [9/N]) - rust-lang/rust#158020 (Update mingw-w64 C toolchain) - rust-lang/rust#158039 (c-variadic: test that we use equality up to free lifetimes) - rust-lang/rust#158060 (Reorganize `tests/ui/issues` [10/N]) - rust-lang/rust#158222 (format: ignore println newline in foreign format hints) - rust-lang/rust#158223 (Move target checking for #[lang] to the attribute parser) - rust-lang/rust#158252 (Use `cfg_select` in `std::os`) - rust-lang/rust#158263 (Only load the feature list once in the entire resolver) - rust-lang/rust#158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - rust-lang/rust#158272 (Reorganize `tests/ui/issues` [13/N]) - rust-lang/rust#158274 (triagebot: Stop pinging myself) - rust-lang/rust#158282 (slice_split_once: bounds check optimization note) - rust-lang/rust#158300 (Improve unknown crate_type diagnostic suggestions) - rust-lang/rust#158304 (mailmap: update mu001999) - rust-lang/rust#158309 (Update `rustc-literal-escaper` version to `0.0.8`) - rust-lang/rust#158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - rust-lang/rust#158326 (Add `io::ErrorKind::TooManyOpenFiles`)
…, r=joboet
std: treat ENFILE as transient in the pidfd support probe
The pidfd support probe special-cases `EMFILE` from `pidfd_open`: it returns the
error without caching anything, so the next spawn re-probes. `ENFILE` falls
through instead, into the fallback arm, so the probe caches pidfd as unsupported
for the rest of the process, even after descriptors free up.
Both errnos come from the same `pidfd_open` call and mean the same thing: the
process is out of file descriptors, just per-process (`EMFILE`) vs system-wide
(`ENFILE`). I don't see a reason to treat them differently here, so this handles
`ENFILE` the same way:
```rust
Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE)) => {
```
I kept the raw `raw_os_error()` check rather than `ErrorKind::TooManyOpenFiles`
(rust-lang#158326, which maps both) to match the rest of this probe, but can switch if
you'd prefer.
I didn't add a test, since triggering it needs real fd exhaustion during the
probe, which isn't practical to reproduce. The `EMFILE` arm isn't tested either.
r? libs
std: treat ENFILE as transient in the pidfd support probe
The pidfd support probe special-cases `EMFILE` from `pidfd_open`: it returns the
error without caching anything, so the next spawn re-probes. `ENFILE` falls
through instead, into the fallback arm, so the probe caches pidfd as unsupported
for the rest of the process, even after descriptors free up.
Both errnos come from the same `pidfd_open` call and mean the same thing: the
process is out of file descriptors, just per-process (`EMFILE`) vs system-wide
(`ENFILE`). I don't see a reason to treat them differently here, so this handles
`ENFILE` the same way:
```rust
Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE)) => {
```
I kept the raw `raw_os_error()` check rather than `ErrorKind::TooManyOpenFiles`
(#158326, which maps both) to match the rest of this probe, but can switch if
you'd prefer.
I didn't add a test, since triggering it needs real fd exhaustion during the
probe, which isn't practical to reproduce. The `EMFILE` arm isn't tested either.
r? libs
Rollup merge of #158486 - valentynkit:pidfd-enfile-transient, r=joboet std: treat ENFILE as transient in the pidfd support probe The pidfd support probe special-cases `EMFILE` from `pidfd_open`: it returns the error without caching anything, so the next spawn re-probes. `ENFILE` falls through instead, into the fallback arm, so the probe caches pidfd as unsupported for the rest of the process, even after descriptors free up. Both errnos come from the same `pidfd_open` call and mean the same thing: the process is out of file descriptors, just per-process (`EMFILE`) vs system-wide (`ENFILE`). I don't see a reason to treat them differently here, so this handles `ENFILE` the same way: ```rust Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE)) => { ``` I kept the raw `raw_os_error()` check rather than `ErrorKind::TooManyOpenFiles` (#158326, which maps both) to match the rest of this probe, but can switch if you'd prefer. I didn't add a test, since triggering it needs real fd exhaustion during the probe, which isn't practical to reproduce. The `EMFILE` arm isn't tested either. r? libs
Rollup of 35 pull requests Successful merges: - rust-lang/rust#158315 (`rust-analyzer` subtree update) - rust-lang/rust#158336 (Stop excluding `stdarch` test crates from `rust-src`) - rust-lang/rust#155739 (Add temporary scope to assert_eq and assert_ne) - rust-lang/rust#156885 (Fix misattributed type inference error span for index expressions) - rust-lang/rust#157271 (simplify some `proc_macro` things) - rust-lang/rust#157419 (move rustc_type_ir Term things to term_kind.rs) - rust-lang/rust#157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - rust-lang/rust#157921 (trait solver: Resolve region vars in max universe) - rust-lang/rust#157960 (delegation: add support for infers in generics) - rust-lang/rust#157983 (Lift the same-signature restriction for `extern "tail"`) - rust-lang/rust#158053 (Optimize network address parser) - rust-lang/rust#158105 (Extract all instance shim variants into new `ShimKind` enum) - rust-lang/rust#158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - rust-lang/rust#158279 (Follow goto and drop when linting unreachable code) - rust-lang/rust#157527 (Move derive tests into their dedicated folder) - rust-lang/rust#157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - rust-lang/rust#157939 (Reorganize `tests/ui/issues` [8/N]) - rust-lang/rust#157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - rust-lang/rust#158003 (Reorganize `tests/ui/issues` [9/N]) - rust-lang/rust#158020 (Update mingw-w64 C toolchain) - rust-lang/rust#158039 (c-variadic: test that we use equality up to free lifetimes) - rust-lang/rust#158060 (Reorganize `tests/ui/issues` [10/N]) - rust-lang/rust#158222 (format: ignore println newline in foreign format hints) - rust-lang/rust#158223 (Move target checking for #[lang] to the attribute parser) - rust-lang/rust#158252 (Use `cfg_select` in `std::os`) - rust-lang/rust#158263 (Only load the feature list once in the entire resolver) - rust-lang/rust#158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - rust-lang/rust#158272 (Reorganize `tests/ui/issues` [13/N]) - rust-lang/rust#158274 (triagebot: Stop pinging myself) - rust-lang/rust#158282 (slice_split_once: bounds check optimization note) - rust-lang/rust#158300 (Improve unknown crate_type diagnostic suggestions) - rust-lang/rust#158304 (mailmap: update mu001999) - rust-lang/rust#158309 (Update `rustc-literal-escaper` version to `0.0.8`) - rust-lang/rust#158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - rust-lang/rust#158326 (Add `io::ErrorKind::TooManyOpenFiles`)
Adds an unstable
io::ErrorKind::TooManyOpenFilesfor the open-file-limit condition.EMFILEandENFILEcurrently decode toErrorKind::Uncategorized, so stable code cannot tell that an operation failed because the process or the system ran out of file descriptors without inspectingraw_os_error()and a platform-specificlibc/windows-sysconstant.Implements the accepted ACP rust-lang/libs-team#818, including its decision to collapse
EMFILEandENFILEinto a single variant. Finer-grained handling stays available throughraw_os_error().The variant maps:
EMFILE/ENFILEon Unix and WASIERROR_TOO_MANY_OPEN_FILES/WSAEMFILEon WindowsFR_TOO_MANY_OPEN_FILESon VEXosTracking issue: #158319
r? libs