mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rollup merge of #110072 - joshtriplett:stabilize-is-terminal, r=Mark-Simulacrum
Stabilize IsTerminal FCP completed in https://github.com/rust-lang/rust/issues/98070 . closes: https://github.com/rust-lang/rust/issues/98070
This commit is contained in:
commit
6161fb8c65
@ -5,7 +5,6 @@
|
|||||||
//! This API is completely unstable and subject to change.
|
//! This API is completely unstable and subject to change.
|
||||||
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![feature(is_terminal)]
|
|
||||||
#![feature(lazy_cell)]
|
#![feature(lazy_cell)]
|
||||||
#![feature(decl_macro)]
|
#![feature(decl_macro)]
|
||||||
#![recursion_limit = "256"]
|
#![recursion_limit = "256"]
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#![feature(array_windows)]
|
#![feature(array_windows)]
|
||||||
#![feature(drain_filter)]
|
#![feature(drain_filter)]
|
||||||
#![feature(if_let_guard)]
|
#![feature(if_let_guard)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
#![feature(adt_const_params)]
|
#![feature(adt_const_params)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
|
|
||||||
#![deny(rustc::untranslatable_diagnostic)]
|
#![deny(rustc::untranslatable_diagnostic)]
|
||||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
|
|
||||||
use std::env::{self, VarError};
|
use std::env::{self, VarError};
|
||||||
use std::fmt::{self, Display};
|
use std::fmt::{self, Display};
|
||||||
|
@ -268,7 +268,7 @@ pub(crate) use self::stdio::attempt_print_to_stderr;
|
|||||||
#[unstable(feature = "internal_output_capture", issue = "none")]
|
#[unstable(feature = "internal_output_capture", issue = "none")]
|
||||||
#[doc(no_inline, hidden)]
|
#[doc(no_inline, hidden)]
|
||||||
pub use self::stdio::set_output_capture;
|
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;
|
pub use self::stdio::IsTerminal;
|
||||||
#[unstable(feature = "print_internals", issue = "none")]
|
#[unstable(feature = "print_internals", issue = "none")]
|
||||||
pub use self::stdio::{_eprint, _print};
|
pub use self::stdio::{_eprint, _print};
|
||||||
|
@ -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.
|
/// 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 {
|
pub trait IsTerminal: crate::sealed::Sealed {
|
||||||
/// Returns `true` if the descriptor/handle refers to a terminal/tty.
|
/// 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].
|
/// Note that this [may change in the future][changes].
|
||||||
///
|
///
|
||||||
/// [changes]: io#platform-specific-behavior
|
/// [changes]: io#platform-specific-behavior
|
||||||
|
#[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")]
|
||||||
fn is_terminal(&self) -> bool;
|
fn is_terminal(&self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1071,7 +1072,7 @@ macro_rules! impl_is_terminal {
|
|||||||
#[unstable(feature = "sealed", issue = "none")]
|
#[unstable(feature = "sealed", issue = "none")]
|
||||||
impl crate::sealed::Sealed for $t {}
|
impl crate::sealed::Sealed for $t {}
|
||||||
|
|
||||||
#[unstable(feature = "is_terminal", issue = "98070")]
|
#[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")]
|
||||||
impl IsTerminal for $t {
|
impl IsTerminal for $t {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_terminal(&self) -> bool {
|
fn is_terminal(&self) -> bool {
|
||||||
|
@ -254,7 +254,6 @@
|
|||||||
#![feature(exhaustive_patterns)]
|
#![feature(exhaustive_patterns)]
|
||||||
#![feature(if_let_guard)]
|
#![feature(if_let_guard)]
|
||||||
#![feature(intra_doc_pointers)]
|
#![feature(intra_doc_pointers)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
#![feature(lang_items)]
|
#![feature(lang_items)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(linkage)]
|
#![feature(linkage)]
|
||||||
|
@ -201,7 +201,7 @@ macro_rules! impl_is_terminal {
|
|||||||
#[unstable(feature = "sealed", issue = "none")]
|
#[unstable(feature = "sealed", issue = "none")]
|
||||||
impl crate::sealed::Sealed for $t {}
|
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 {
|
impl crate::io::IsTerminal for $t {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_terminal(&self) -> bool {
|
fn is_terminal(&self) -> bool {
|
||||||
|
@ -389,7 +389,7 @@ macro_rules! impl_is_terminal {
|
|||||||
#[unstable(feature = "sealed", issue = "none")]
|
#[unstable(feature = "sealed", issue = "none")]
|
||||||
impl crate::sealed::Sealed for $t {}
|
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 {
|
impl crate::io::IsTerminal for $t {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_terminal(&self) -> bool {
|
fn is_terminal(&self) -> bool {
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#![unstable(feature = "test", issue = "50297")]
|
#![unstable(feature = "test", issue = "50297")]
|
||||||
#![doc(test(attr(deny(warnings))))]
|
#![doc(test(attr(deny(warnings))))]
|
||||||
#![feature(internal_output_capture)]
|
#![feature(internal_output_capture)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
#![feature(staged_api)]
|
#![feature(staged_api)]
|
||||||
#![feature(process_exitcode_internals)]
|
#![feature(process_exitcode_internals)]
|
||||||
#![feature(panic_can_unwind)]
|
#![feature(panic_can_unwind)]
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#![feature(assert_matches)]
|
#![feature(assert_matches)]
|
||||||
#![feature(box_patterns)]
|
#![feature(box_patterns)]
|
||||||
#![feature(drain_filter)]
|
#![feature(drain_filter)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(test)]
|
#![feature(test)]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#![feature(yeet_expr)]
|
#![feature(yeet_expr)]
|
||||||
#![feature(nonzero_ops)]
|
#![feature(nonzero_ops)]
|
||||||
#![feature(local_key_cell_methods)]
|
#![feature(local_key_cell_methods)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
#![feature(round_ties_even)]
|
#![feature(round_ties_even)]
|
||||||
// Configure clippy and other lints
|
// Configure clippy and other lints
|
||||||
#![allow(
|
#![allow(
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#![feature(io_error_more)]
|
#![feature(io_error_more)]
|
||||||
#![feature(io_error_uncategorized)]
|
#![feature(io_error_uncategorized)]
|
||||||
#![feature(is_terminal)]
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ffi::{c_char, OsString};
|
use std::ffi::{c_char, OsString};
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(is_terminal)]
|
|
||||||
|
|
||||||
use std::io::IsTerminal;
|
use std::io::IsTerminal;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user