rust/library/std/src/sys_common
Alex Crichton 672ea93652 std: Invert logic for inclusion of sys_common::net
The `library/std/src/sys_common/net.rs` module is intended to define
common implementations of networking-related APIs across a variety of
platforms that share similar APIs (e.g. Berkeley-style sockets and all).
This module is not included for more fringe targets however such as UEFI
or "unknown" targets to libstd (those classified as `restricted-std`).
Previously the `sys_common/net.rs` file was set up such that an
allow-list indicated it shouldn't be used. This commit inverts the logic
to have an allow-list of when it should be used instead.

The goal of this commit is to make it a bit easier to experiment with a
new Rust target. Currently more esoteric targets are required to get an
exception in this `cfg_if` block to use `crate::sys::net` such as for
unsupported targets. With this inversion of logic only targets which
actually support networking will be listed, where most of those are
lumped under `cfg(unix)`.

Given that this change is likely to cause some breakage for some target
by accident I've attempted to be somewhat robust with this by following
these steps to defining the new predicate for inverted logic.

1. Take all supported targets and filter out all `cfg(unix)` ones as
   these should all support `sys_common/net.rs`.
2. Take remaining targets and filter out `cfg(windows)` ones.
3. The remaining dozen-or-so targets were all audited by hand. Mostly
   this included `target_os = "hermit"` and `target_os = "solid_asp3"`
   which required an allow-list entry, but remaining targets were all
   already excluded (didn't use `sys_common/net.rs` so they were left
   out.

If this causes breakage it should be relatively easy to fix and I'd be
happy to follow-up with any PRs necessary.
2023-12-02 11:38:32 -08:00
..
memchr Move std::memchr to sys_common 2021-05-14 03:54:46 +02:00
net Match unmatched backticks in library/ 2023-03-03 03:03:29 +01:00
once Re-format code with new rustfmt 2023-11-15 21:45:48 -05:00
thread_local_key Update test. 2023-04-27 15:25:48 +02:00
thread_parking std: synchronize with all calls to unpark in id-based thread parker 2023-08-07 19:13:34 +02:00
wtf8 Rollup merge of #98202 - aticu:impl_tryfrom_osstr_for_str, r=Amanieu 2023-06-14 18:10:27 +02:00
backtrace.rs Use ptr::invalid_mut for SGX image base 2023-11-17 11:49:23 -08:00
fs.rs Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
io.rs Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00
lazy_box.rs Leak pthreax_mutex_t when it's dropped while locked. 2022-06-16 12:09:12 +02:00
memchr.rs Move std::memchr to sys_common 2021-05-14 03:54:46 +02:00
mod.rs std: Invert logic for inclusion of sys_common::net 2023-12-02 11:38:32 -08:00
net.rs Make TCP connect() handle EINTR correctly 2023-10-13 18:12:56 +07:00
process.rs also print clearing the environment entirely 2023-08-24 08:08:46 +02:00
tests.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
thread.rs Relax memory ordering used in min_stack 2022-05-01 15:55:54 -07:00
thread_info.rs Refactor thread_info to remove the RefCell 2023-09-11 14:11:37 -04:00
thread_local_dtor.rs std: abort instead of panicking if the global allocator uses TLS 2023-10-04 11:49:48 +02:00
thread_local_key.rs Remove unused std::sys_common::thread_local_key::Key. 2023-04-27 15:25:48 +02:00
wstr.rs Extract WStrUnits to sys_common::wstr 2022-11-28 21:17:08 +05:30
wtf8.rs std: add some missing repr(transparent) 2023-08-14 10:40:59 +02:00