rust/library/std
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
..
benches
src Auto merge of #84115 - CDirkx:rt, r=m-ou-se 2021-04-25 04:45:39 +00:00
tests
build.rs
Cargo.toml Auto merge of #83776 - jyn514:update-stdarch-docs, r=Amanieu 2021-04-12 18:29:25 +00:00