Skip to content
/ rust Public
forked from rust-lang/rust

Commit dea5b4f

Browse files
authored
Rollup merge of rust-lang#114098 - klensy:drop-atty, r=fee1-dead
replace atty crate with std's IsTerminal
2 parents 17e4f80 + 3163085 commit dea5b4f

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

Cargo.lock

-2
Original file line numberDiff line numberDiff line change
@@ -3734,7 +3734,6 @@ dependencies = [
37343734
name = "rustc_interface"
37353735
version = "0.0.0"
37363736
dependencies = [
3737-
"atty",
37383737
"libloading",
37393738
"rustc-rayon",
37403739
"rustc-rayon-core",
@@ -4198,7 +4197,6 @@ dependencies = [
41984197
name = "rustc_session"
41994198
version = "0.0.0"
42004199
dependencies = [
4201-
"atty",
42024200
"bitflags 1.3.2",
42034201
"getopts",
42044202
"libc",

compiler/rustc_interface/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66
[lib]
77

88
[dependencies]
9-
atty = "0.2.13"
109
libloading = "0.7.1"
1110
tracing = "0.1"
1211
rustc-rayon-core = { version = "0.5.0", optional = true }

compiler/rustc_interface/src/util.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ fn multiple_output_types_to_stdout(
519519
output_types: &OutputTypes,
520520
single_output_file_is_stdout: bool,
521521
) -> bool {
522-
if atty::is(atty::Stream::Stdout) {
522+
use std::io::IsTerminal;
523+
if std::io::stdout().is_terminal() {
523524
// If stdout is a tty, check if multiple text output types are
524525
// specified by `--emit foo=- --emit bar=-` or `-o - --emit foo,bar`
525526
let named_text_types = output_types

compiler/rustc_session/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7-
atty = "0.2.13"
87
bitflags = "1.2.1"
98
getopts = "0.2"
109
rustc_macros = { path = "../rustc_macros" }

compiler/rustc_session/src/config.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,10 @@ impl OutFileName {
834834
}
835835

836836
pub fn is_tty(&self) -> bool {
837+
use std::io::IsTerminal;
837838
match *self {
838839
OutFileName::Real(_) => false,
839-
OutFileName::Stdout => atty::is(atty::Stream::Stdout),
840+
OutFileName::Stdout => std::io::stdout().is_terminal(),
840841
}
841842
}
842843

0 commit comments

Comments
 (0)