1
Fork 0
rust/library/std/src
bors 5da10c0121 Auto merge of #84115 - CDirkx:rt, r=m-ou-se
Rework `init` and `cleanup`

This PR reworks the code in `std` that runs before and after `main` and centralizes this code respectively in the functions `init` and `cleanup` in both `sys_common` and `sys`. This makes is easy to see what code is executed during initialization and cleanup on each platform just by looking at e.g. `sys::windows::init`.

Full list of changes:
- new module `rt` in `sys_common` to contain `init` and `cleanup` and the runtime macros.
- `at_exit` and the mechanism to register exit handlers has been completely removed. In practice this was only used for closing sockets on windows and flushing stdout, which have been moved to `cleanup`.
- <s>On windows `alloc` and `net` initialization is now done in `init`, this saves a runtime check in every allocation and network use.</s>
2021-04-25 04:45:39 +00:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f64 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
ffi Add a few missing links, fix a typo 2021-03-31 16:02:59 +02:00
fs Fix test metadata_access_times to also check for Unsupported 2021-04-18 09:29:24 +02:00
io Rework at_exit to cleanup 2021-04-22 10:34:48 +02:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
memchr std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
net Add documentation to help people find Ipv4Addr::UNSPECIFIED 2021-04-16 13:18:04 -07:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Deprecate std::os::haiku::raw 2021-03-16 17:43:33 -04:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Refactor parse_prefix on Windows 2020-11-07 16:15:48 +01:00
prelude Bump cfgs 2021-04-04 14:57:05 -04:00
process std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
sync Move sys_common::poison to sync::poison 2021-04-22 10:27:21 +02:00
sys Auto merge of #84115 - CDirkx:rt, r=m-ou-se 2021-04-25 04:45:39 +00:00
sys_common Auto merge of #84115 - CDirkx:rt, r=m-ou-se 2021-04-25 04:45:39 +00:00
thread Rollup merge of #84013 - CDirkx:fmt, r=m-ou-se 2021-04-21 23:06:11 +02:00
time Duration::zero() -> Duration::ZERO 2020-10-21 20:44:03 -07:00
alloc.rs Fix safety comment 2021-01-07 09:13:21 +01:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
env.rs Rollup merge of #84413 - CDirkx:args_inner_debug, r=m-ou-se 2021-04-22 18:14:43 +02:00
error.rs Document "standard" conventions for error messages 2021-04-02 15:11:49 +03:00
f32.rs doc: cube root, not cubic root 2021-02-26 19:03:44 +01:00
f64.rs doc: cube root, not cubic root 2021-02-26 19:03:44 +01:00
fs.rs clean up example on read_to_string 2021-04-10 12:50:04 -05:00
keyword_docs.rs Turn old edition lints (anonymous-parameters, keyword-idents) into warn-by-default on 2015 2021-04-12 09:45:59 -07:00
lazy.rs Use DebugStruct::finish_non_exhaustive() in std. 2021-03-27 13:29:23 +01:00
lib.rs Auto merge of #84207 - SimonSapin:deprecate-core-raw, r=dtolnay 2021-04-18 07:23:54 +00:00
macros.rs Use #[doc = include_str!()] in std 2021-02-23 15:54:55 +01:00
memchr.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
num.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
panic.rs Fixed minor typo in catch_unwind docs 2021-02-13 16:59:06 +01:00
panicking.rs fix another comment, and make __rust_start_panic code a bit more semantically clear 2020-12-25 23:37:27 +01:00
path.rs Apply suggestions from code review 2021-03-31 16:09:25 +02:00
primitive_docs.rs Update library/std/src/primitive_docs.rs 2021-04-19 02:58:38 +02:00
process.rs Rework at_exit to cleanup 2021-04-22 10:34:48 +02:00
rt.rs Remove Once from init 2021-04-22 18:00:18 +02:00
time.rs Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00