From bdc2a49cf2990ac57fac1110dcb28b41b51eb455 Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Fri, 28 Aug 2026 21:17:58 +0300 Subject: [PATCH] std::io: impl IsTerminal for {Empty, Repeat, Sink, Take} --- library/std/src/io/stdio.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index b104ea69cd1fc..f3c5e03a515e8 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -1264,6 +1264,34 @@ macro_rules! impl_is_terminal { impl_is_terminal!(File, Stdin, StdinLock<'_>, Stdout, StdoutLock<'_>, Stderr, StderrLock<'_>); +#[stable(feature = "more_is_terminal", since = "CURRENT_RUSTC_VERSION")] +impl IsTerminal for crate::io::Empty { + fn is_terminal(&self) -> bool { + false + } +} + +#[stable(feature = "more_is_terminal", since = "CURRENT_RUSTC_VERSION")] +impl IsTerminal for crate::io::Repeat { + fn is_terminal(&self) -> bool { + false + } +} + +#[stable(feature = "more_is_terminal", since = "CURRENT_RUSTC_VERSION")] +impl IsTerminal for crate::io::Sink { + fn is_terminal(&self) -> bool { + false + } +} + +#[stable(feature = "more_is_terminal", since = "CURRENT_RUSTC_VERSION")] +impl IsTerminal for crate::io::Take { + fn is_terminal(&self) -> bool { + self.inner.is_terminal() + } +} + #[unstable( feature = "print_internals", reason = "implementation detail which may disappear or be replaced at any time",