Skip to content

Commit d60ba29

Browse files
committedOct 16, 2022
Use IsTerminal in rustc_log
1 parent 34f61dd commit d60ba29

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed
 

‎Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -3724,7 +3724,6 @@ dependencies = [
37243724
name = "rustc_log"
37253725
version = "0.0.0"
37263726
dependencies = [
3727-
"atty",
37283727
"rustc_span",
37293728
"tracing",
37303729
"tracing-subscriber",

‎compiler/rustc_log/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"
87
tracing = "0.1.28"
98
tracing-subscriber = { version = "0.3.3", default-features = false, features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"] }
109
tracing-tree = "0.2.0"

‎compiler/rustc_log/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@
4040
4141
#![deny(rustc::untranslatable_diagnostic)]
4242
#![deny(rustc::diagnostic_outside_of_impl)]
43+
#![feature(is_terminal)]
4344

4445
use std::env::{self, VarError};
4546
use std::fmt::{self, Display};
46-
use std::io;
47+
use std::io::{self, IsTerminal};
4748
use tracing_subscriber::filter::{Directive, EnvFilter, LevelFilter};
4849
use tracing_subscriber::layer::SubscriberExt;
4950

@@ -93,11 +94,11 @@ pub fn init_env_logger(env: &str) -> Result<(), Error> {
9394
}
9495

9596
pub fn stdout_isatty() -> bool {
96-
atty::is(atty::Stream::Stdout)
97+
io::stdout().is_terminal()
9798
}
9899

99100
pub fn stderr_isatty() -> bool {
100-
atty::is(atty::Stream::Stderr)
101+
io::stderr().is_terminal()
101102
}
102103

103104
#[derive(Debug)]

0 commit comments

Comments
 (0)