-/// Resets the thread-local stderr handle to the specified writer
-///
-/// This will replace the current thread's stderr handle, returning the old
-/// handle. All future calls to `panic!` and friends will emit their output to
-/// this specified handle.
-///
-/// Note that this does not need to be called for all new threads; the default
-/// output handle is to the process's stderr stream.
-#[unstable(
- feature = "set_stdio",
- reason = "this function may disappear completely or be replaced \
- with a more general mechanism",
- issue = "none"
-)]
-#[doc(hidden)]
-pub fn set_panic(sink: Option<LocalStream>) -> Option<LocalStream> {
- if sink.is_none() && !LOCAL_STREAMS.load(Ordering::Relaxed) {
- // LOCAL_STDERR is definitely None since LOCAL_STREAMS is false.
- return None;
- }
- LOCAL_STREAMS.store(true, Ordering::Relaxed);
- LOCAL_STDERR.with(move |slot| slot.replace(sink))
-}
-
-/// Resets the thread-local stdout handle to the specified writer
-///
-/// This will replace the current thread's stdout handle, returning the old
-/// handle. All future calls to `print!` and friends will emit their output to
-/// this specified handle.
-///
-/// Note that this does not need to be called for all new threads; the default
-/// output handle is to the process's stdout stream.