rust/src/libstd
Dylan DPC 276b54e9c9
Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfackler
Fix abort-on-eprintln during process shutdown

This commit fixes an issue where if `eprintln!` is used in a TLS
destructor it can accidentally cause the process to abort. TLS
destructors are executed after `main` returns on the main thread, and at
this point we've also deinitialized global `Lazy` values like those
which store the `Stderr` and `Stdout` internals. This means that despite
handling TLS not being accessible in `eprintln!`, we will fail due to
not being able to call `stderr()`. This means that we'll double-panic
quickly because panicking also attempt to write to stderr.

The fix here is to reimplement the global stderr handle to avoid the
need for destruction. This avoids the need for `Lazy` as well as the
hidden panic inside of the `stderr` function.

Overall this should improve the robustness of printing errors and/or
panics in weird situations, since the `stderr` accessor should be
infallible in more situations.
2020-03-21 13:06:38 +01:00
..
benches Format libstd with rustfmt 2019-11-29 18:43:27 -08:00
collections Don't redundantly repeat field names (clippy::redundant_field_names) 2020-03-06 19:42:18 +01:00
ffi Rollup merge of #64069 - danielhenrymantilla:feature/cstring_from_vec_of_nonzerou8, r=KodrAus 2020-02-15 09:45:38 +01:00
io Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfackler 2020-03-21 13:06:38 +01:00
net fix various typos 2020-03-06 15:19:31 +01:00
os fix various typos 2020-03-06 15:19:31 +01:00
prelude builtin_macros: Add attribute macro #[cfg_accessible(path)] 2020-03-10 01:02:13 +03:00
sync Fix "since" field for Once::is_complete's #[stable] attribute 2020-03-15 10:19:26 +01:00
sys Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfackler 2020-03-21 13:06:38 +01:00
sys_common Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfackler 2020-03-21 13:06:38 +01:00
tests stdarch: update submodule. 2020-02-01 22:04:18 -05:00
thread Add an unstable conversion from thread ID to u64 2020-01-06 10:56:13 -05:00
alloc.rs Allow ZSTs in AllocRef 2020-03-08 11:01:12 +01:00
ascii.rs Format libstd with rustfmt 2019-11-29 18:43:27 -08:00
backtrace.rs remove redundant returns (clippy::needless_return) 2020-03-20 20:23:03 +01:00
build.rs remove dependency from libhermit 2019-11-25 08:59:23 +01:00
Cargo.toml Bump version to backtrace without the header 2020-02-10 14:20:21 -08:00
env.rs doc: Add quote to .init_array 2020-03-19 17:35:28 +07:00
error.rs Rollup merge of #69792 - LenaWil:try_reserve_error/impl-error, r=sfackler 2020-03-12 16:32:21 +01:00
f32.rs Add notice about using new consts in new code on float modules 2020-02-12 20:20:56 +01:00
f64.rs Add notice about using new consts in new code on float modules 2020-02-12 20:20:56 +01:00
fs.rs Fix missing ` in doc for File::with_options 2020-03-06 14:27:09 +00:00
future.rs Add futures scaffolding to libcore 2020-03-17 22:17:31 +01:00
keyword_docs.rs Rollup merge of #67749 - gilescope:keyword-in, r=Dylan-DPC 2020-03-18 18:03:31 +01:00
lib.rs Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasper 2020-03-17 03:05:12 +01:00
macros.rs Update macros.rs: fix documentation typo. 2020-03-04 14:18:31 -05:00
memchr.rs libstd => 2018 2019-02-28 04:06:15 +09:00
num.rs Format libstd with rustfmt 2019-11-29 18:43:27 -08:00
panic.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
panicking.rs Auto merge of #70010 - Amanieu:fix-opt-catch, r=Mark-Simulacrum 2020-03-16 08:08:51 +00:00
path.rs remove unneeded .as_ref() calls. 2020-02-29 02:16:04 +01:00
primitive_docs.rs Add notice about using new consts in new code on float modules 2020-02-12 20:20:56 +01:00
process.rs Format libstd with rustfmt 2019-11-29 18:43:27 -08:00
rt.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
time.rs correct comment to match behavior 2020-02-29 08:40:09 -05:00