summaryrefslogtreecommitdiff
path: root/src/libstd/sys/cloudabi/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-27 17:39:01 +0000
committerbors <bors@rust-lang.org>2020-07-27 17:39:01 +0000
commit54e000891ffccd4cbfb92146b92736c83085df63 (patch)
tree1200bb13eb9ae22def4c43bc657bc56da8faedc6 /src/libstd/sys/cloudabi/mod.rs
parent4a90e36c85336d1d4b209556c1a9733210bbff19 (diff)
parent6d9705220fec4553d693a7c19d99496e14c89edf (diff)
downloadrust-tmp-nightly.tar.gz
Auto merge of #73265 - mark-i-m:mv-std, r=<try>tmp-nightly
mv std libs to library/ This is the first step in refactoring the directory layout of this repository, with further followup steps planned (but not done yet). Background: currently, all crates are under src/, without nested src directories and with the unconventional `lib*` prefixes (e.g., `src/libcore/lib.rs`). This directory structures is not idiomatic and makes the `src/` directory rather overwhelming. To improve contributor experience and make things a bit more approachable, we are reorganizing the repo a bit. In this PR, we move the standard libs (basically anything that is "runtime", as opposed to part of the compiler, build system, or one of the tools, etc). The new layout moves these libraries to a new `library/` directory in the root of the repo. Additionally, we remove the `lib*` prefixes and add nested `src/` directories. The other crates/tools in this repo are not touched. So in summary: ``` library/<crate>/src/*.rs src/<all the rest> // unchanged ``` where `<crate>` is: - core - alloc - std - test - proc_macro - panic_abort - panic_unwind - profiler_builtins - term - unwind - rtstartup - backtrace - rustc-std-workspace-* There was a lot of discussion about this and a few rounds of compiler team approvals, FCPs, MCPs, and nominations. The original MCP is https://github.com/rust-lang/compiler-team/issues/298. The final approval of the compiler team was given here: https://github.com/rust-lang/rust/pull/73265#issuecomment-659498446. The name `library` was chosen to complement a later move of the compiler crates to a `compiler/` directory. There was a lot of discussion around adding the nested `src/` directories. Note that this does increase the nesting depth (plausibly important for manual traversal of the tree, e.g., through GitHub's UI or `cd`), but this is deemed to be better as it fits the standard layout of Rust crates throughout most of the ecosystem, though there is some debate about how much this should apply to multi-crate projects. Overall, there seem to be more people in favor of nested `src/` than against. After this PR, there are no dependencies out of the `library/` directory except on the `build_helper` (or crates.io crates).
Diffstat (limited to 'src/libstd/sys/cloudabi/mod.rs')
-rw-r--r--src/libstd/sys/cloudabi/mod.rs66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/libstd/sys/cloudabi/mod.rs b/src/libstd/sys/cloudabi/mod.rs
deleted file mode 100644
index f7dd2c8d00f..00000000000
--- a/src/libstd/sys/cloudabi/mod.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-use crate::io::ErrorKind;
-use crate::mem;
-
-#[path = "../unix/alloc.rs"]
-pub mod alloc;
-pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
-pub mod condvar;
-pub mod io;
-#[path = "../unix/memchr.rs"]
-pub mod memchr;
-pub mod mutex;
-pub mod os;
-pub mod rwlock;
-pub mod stack_overflow;
-pub mod stdio;
-pub mod thread;
-#[path = "../unix/thread_local_key.rs"]
-pub mod thread_local_key;
-pub mod time;
-
-pub use crate::sys_common::os_str_bytes as os_str;
-
-mod abi;
-
-mod shims;
-pub use self::shims::*;
-
-#[allow(dead_code)]
-pub fn init() {}
-
-pub fn decode_error_kind(errno: i32) -> ErrorKind {
- match errno {
- x if x == abi::errno::ACCES as i32 => ErrorKind::PermissionDenied,
- x if x == abi::errno::ADDRINUSE as i32 => ErrorKind::AddrInUse,
- x if x == abi::errno::ADDRNOTAVAIL as i32 => ErrorKind::AddrNotAvailable,
- x if x == abi::errno::AGAIN as i32 => ErrorKind::WouldBlock,
- x if x == abi::errno::CONNABORTED as i32 => ErrorKind::ConnectionAborted,
- x if x == abi::errno::CONNREFUSED as i32 => ErrorKind::ConnectionRefused,
- x if x == abi::errno::CONNRESET as i32 => ErrorKind::ConnectionReset,
- x if x == abi::errno::EXIST as i32 => ErrorKind::AlreadyExists,
- x if x == abi::errno::INTR as i32 => ErrorKind::Interrupted,
- x if x == abi::errno::INVAL as i32 => ErrorKind::InvalidInput,
- x if x == abi::errno::NOENT as i32 => ErrorKind::NotFound,
- x if x == abi::errno::NOTCONN as i32 => ErrorKind::NotConnected,
- x if x == abi::errno::PERM as i32 => ErrorKind::PermissionDenied,
- x if x == abi::errno::PIPE as i32 => ErrorKind::BrokenPipe,
- x if x == abi::errno::TIMEDOUT as i32 => ErrorKind::TimedOut,
- _ => ErrorKind::Other,
- }
-}
-
-pub fn abort_internal() -> ! {
- core::intrinsics::abort();
-}
-
-pub use libc::strlen;
-
-pub fn hashmap_random_keys() -> (u64, u64) {
- unsafe {
- let mut v: mem::MaybeUninit<(u64, u64)> = mem::MaybeUninit::uninit();
- libc::arc4random_buf(v.as_mut_ptr() as *mut libc::c_void, mem::size_of_val(&v));
- v.assume_init()
- }
-}