From afd45c2e10d9a5dbb277852384bb3d2245239f63 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 8 Apr 2023 14:24:16 +0900 Subject: [PATCH] Stabilize IsTerminal closes: https://github.com/rust-lang/rust/issues/98070 --- compiler/rustc_driver_impl/src/lib.rs | 1 - compiler/rustc_errors/src/lib.rs | 1 - compiler/rustc_log/src/lib.rs | 1 - library/std/src/io/mod.rs | 2 +- library/std/src/io/stdio.rs | 5 +++-- library/std/src/lib.rs | 1 - library/std/src/os/fd/owned.rs | 2 +- library/std/src/os/windows/io/handle.rs | 2 +- library/test/src/lib.rs | 1 - src/librustdoc/lib.rs | 1 - src/tools/miri/src/lib.rs | 1 - src/tools/miri/tests/pass/shims/fs.rs | 1 - src/tools/miri/tests/pass/shims/io.rs | 2 -- 13 files changed, 6 insertions(+), 15 deletions(-) diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 730d41ab962..ba5873d79a2 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -5,7 +5,6 @@ //! This API is completely unstable and subject to change. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(is_terminal)] #![feature(lazy_cell)] #![feature(decl_macro)] #![recursion_limit = "256"] diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 9866a9bffe0..cee62d23754 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -6,7 +6,6 @@ #![feature(array_windows)] #![feature(drain_filter)] #![feature(if_let_guard)] -#![feature(is_terminal)] #![feature(adt_const_params)] #![feature(let_chains)] #![feature(never_type)] diff --git a/compiler/rustc_log/src/lib.rs b/compiler/rustc_log/src/lib.rs index 21f6a404a01..3cbb2c21e28 100644 --- a/compiler/rustc_log/src/lib.rs +++ b/compiler/rustc_log/src/lib.rs @@ -40,7 +40,6 @@ #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] -#![feature(is_terminal)] use std::env::{self, VarError}; use std::fmt::{self, Display}; diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 4b31c552eed..020c723925a 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -268,7 +268,7 @@ pub(crate) use self::stdio::attempt_print_to_stderr; #[unstable(feature = "internal_output_capture", issue = "none")] #[doc(no_inline, hidden)] pub use self::stdio::set_output_capture; -#[unstable(feature = "is_terminal", issue = "98070")] +#[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] pub use self::stdio::IsTerminal; #[unstable(feature = "print_internals", issue = "none")] pub use self::stdio::{_eprint, _print}; diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index 1a3200a5c62..b2c57b8ddc7 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -1047,7 +1047,7 @@ pub(crate) fn attempt_print_to_stderr(args: fmt::Arguments<'_>) { } /// Trait to determine if a descriptor/handle refers to a terminal/tty. -#[unstable(feature = "is_terminal", issue = "98070")] +#[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] pub trait IsTerminal: crate::sealed::Sealed { /// Returns `true` if the descriptor/handle refers to a terminal/tty. /// @@ -1063,6 +1063,7 @@ pub trait IsTerminal: crate::sealed::Sealed { /// Note that this [may change in the future][changes]. /// /// [changes]: io#platform-specific-behavior + #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] fn is_terminal(&self) -> bool; } @@ -1071,7 +1072,7 @@ macro_rules! impl_is_terminal { #[unstable(feature = "sealed", issue = "none")] impl crate::sealed::Sealed for $t {} - #[unstable(feature = "is_terminal", issue = "98070")] + #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] impl IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 736b3c0497c..71f3576c93d 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -254,7 +254,6 @@ #![feature(exhaustive_patterns)] #![feature(if_let_guard)] #![feature(intra_doc_pointers)] -#![feature(is_terminal)] #![feature(lang_items)] #![feature(let_chains)] #![feature(linkage)] diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs index a40d39c5e44..6a6e6f33158 100644 --- a/library/std/src/os/fd/owned.rs +++ b/library/std/src/os/fd/owned.rs @@ -201,7 +201,7 @@ macro_rules! impl_is_terminal { #[unstable(feature = "sealed", issue = "none")] impl crate::sealed::Sealed for $t {} - #[unstable(feature = "is_terminal", issue = "98070")] + #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] impl crate::io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs index 1dfecc57338..f6622874625 100644 --- a/library/std/src/os/windows/io/handle.rs +++ b/library/std/src/os/windows/io/handle.rs @@ -389,7 +389,7 @@ macro_rules! impl_is_terminal { #[unstable(feature = "sealed", issue = "none")] impl crate::sealed::Sealed for $t {} - #[unstable(feature = "is_terminal", issue = "98070")] + #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] impl crate::io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs index 88d8e5fe97a..9fb31ed7663 100644 --- a/library/test/src/lib.rs +++ b/library/test/src/lib.rs @@ -17,7 +17,6 @@ #![unstable(feature = "test", issue = "50297")] #![doc(test(attr(deny(warnings))))] #![feature(internal_output_capture)] -#![feature(is_terminal)] #![feature(staged_api)] #![feature(process_exitcode_internals)] #![feature(panic_can_unwind)] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 79f53ee57cc..8ab212099e3 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -7,7 +7,6 @@ #![feature(assert_matches)] #![feature(box_patterns)] #![feature(drain_filter)] -#![feature(is_terminal)] #![feature(let_chains)] #![feature(test)] #![feature(never_type)] diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index fb4e59acd00..dcdec0627b7 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -7,7 +7,6 @@ #![feature(yeet_expr)] #![feature(nonzero_ops)] #![feature(local_key_cell_methods)] -#![feature(is_terminal)] #![feature(round_ties_even)] // Configure clippy and other lints #![allow( diff --git a/src/tools/miri/tests/pass/shims/fs.rs b/src/tools/miri/tests/pass/shims/fs.rs index 7a9974f3938..e379288de01 100644 --- a/src/tools/miri/tests/pass/shims/fs.rs +++ b/src/tools/miri/tests/pass/shims/fs.rs @@ -3,7 +3,6 @@ #![feature(io_error_more)] #![feature(io_error_uncategorized)] -#![feature(is_terminal)] use std::collections::HashMap; use std::ffi::{c_char, OsString}; diff --git a/src/tools/miri/tests/pass/shims/io.rs b/src/tools/miri/tests/pass/shims/io.rs index 4d43549a930..295723957a4 100644 --- a/src/tools/miri/tests/pass/shims/io.rs +++ b/src/tools/miri/tests/pass/shims/io.rs @@ -1,5 +1,3 @@ -#![feature(is_terminal)] - use std::io::IsTerminal; fn main() {