]> git.lizzy.rs Git - rust.git/blob - library/std/src/sys/wasm/mod.rs
Auto merge of #78430 - Nadrieril:taking-constructors-seriously2, r=varkor
[rust.git] / library / std / src / sys / wasm / mod.rs
1 //! System bindings for the wasm/web platform
2 //!
3 //! This module contains the facade (aka platform-specific) implementations of
4 //! OS level functionality for wasm. Note that this wasm is *not* the emscripten
5 //! wasm, so we have no runtime here.
6 //!
7 //! This is all super highly experimental and not actually intended for
8 //! wide/production use yet, it's still all in the experimental category. This
9 //! will likely change over time.
10 //!
11 //! Currently all functions here are basically stubs that immediately return
12 //! errors. The hope is that with a portability lint we can turn actually just
13 //! remove all this and just omit parts of the standard library if we're
14 //! compiling for wasm. That way it's a compile time error for something that's
15 //! guaranteed to be a runtime error!
16
17 #![deny(unsafe_op_in_unsafe_fn)]
18
19 pub mod alloc;
20 pub mod args;
21 #[path = "../unsupported/cmath.rs"]
22 pub mod cmath;
23 pub mod env;
24 #[path = "../unsupported/fs.rs"]
25 pub mod fs;
26 #[path = "../unsupported/io.rs"]
27 pub mod io;
28 #[path = "../unsupported/net.rs"]
29 pub mod net;
30 #[path = "../unsupported/os.rs"]
31 pub mod os;
32 #[path = "../unix/path.rs"]
33 pub mod path;
34 #[path = "../unsupported/pipe.rs"]
35 pub mod pipe;
36 #[path = "../unsupported/process.rs"]
37 pub mod process;
38 #[path = "../unsupported/stack_overflow.rs"]
39 pub mod stack_overflow;
40 #[path = "../unsupported/stdio.rs"]
41 pub mod stdio;
42 pub mod thread;
43 #[path = "../unsupported/thread_local_dtor.rs"]
44 pub mod thread_local_dtor;
45 #[path = "../unsupported/thread_local_key.rs"]
46 pub mod thread_local_key;
47 #[path = "../unsupported/time.rs"]
48 pub mod time;
49
50 pub use crate::sys_common::os_str_bytes as os_str;
51
52 cfg_if::cfg_if! {
53     if #[cfg(target_feature = "atomics")] {
54         #[path = "condvar_atomics.rs"]
55         pub mod condvar;
56         #[path = "mutex_atomics.rs"]
57         pub mod mutex;
58         #[path = "rwlock_atomics.rs"]
59         pub mod rwlock;
60         #[path = "futex_atomics.rs"]
61         pub mod futex;
62     } else {
63         #[path = "../unsupported/condvar.rs"]
64         pub mod condvar;
65         #[path = "../unsupported/mutex.rs"]
66         pub mod mutex;
67         #[path = "../unsupported/rwlock.rs"]
68         pub mod rwlock;
69     }
70 }
71
72 #[path = "../unsupported/common.rs"]
73 #[deny(unsafe_op_in_unsafe_fn)]
74 mod common;
75 pub use common::*;