diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/is-terminal | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/is-terminal')
-rw-r--r-- | vendor/is-terminal/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/is-terminal/Cargo.toml | 15 | ||||
-rw-r--r-- | vendor/is-terminal/README.md | 8 | ||||
-rw-r--r-- | vendor/is-terminal/src/lib.rs | 39 |
4 files changed, 36 insertions, 28 deletions
diff --git a/vendor/is-terminal/.cargo-checksum.json b/vendor/is-terminal/.cargo-checksum.json index 154302230..c006045f8 100644 --- a/vendor/is-terminal/.cargo-checksum.json +++ b/vendor/is-terminal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"d036ee0fd0e9bcfda9f16254fe393435dad77e55531d8b7601f7d036e1469e81","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-MIT-atty":"bab426a663ce3d5bbbcea9cdc300da74e94d76c3c79e46699a953f967a08e533","README.md":"bb23e10d4801dee704d2743631e3ca9de6af95761c649e9bd79d62f2df838c9d","src/lib.rs":"79b159d574dd9bc81473b4b694cded6deab0d65abf673176c17fc1146d36abeb"},"package":"adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f"}
\ No newline at end of file +{"files":{"Cargo.toml":"2fc1b230aeeba472a175fdeebf800f38a7adf0443830b323234d377e37e45eea","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-MIT-atty":"bab426a663ce3d5bbbcea9cdc300da74e94d76c3c79e46699a953f967a08e533","README.md":"252ffd0e461bf2c22cbedd3b05746cc133a3e9e5426635d6a147e575e8295ec3","src/lib.rs":"8df39830a1d8f08194bbf736da9cb23cc357f80f7e7ab472caa941bfb546639f"},"package":"24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"}
\ No newline at end of file diff --git a/vendor/is-terminal/Cargo.toml b/vendor/is-terminal/Cargo.toml index 7957a9c4f..e0baea0f1 100644 --- a/vendor/is-terminal/Cargo.toml +++ b/vendor/is-terminal/Cargo.toml @@ -11,9 +11,9 @@ [package] edition = "2018" -rust-version = "1.48" +rust-version = "1.63" name = "is-terminal" -version = "0.4.7" +version = "0.4.8" authors = [ "softprops <d.tangren@gmail.com>", "Dan Gohman <dev@sunfishcode.online>", @@ -27,7 +27,7 @@ include = [ "/*.md", ] description = "Test whether a given stream is a terminal" -documentation = "http://docs.rs/is-terminal" +documentation = "https://docs.rs/is-terminal" readme = "README.md" keywords = [ "terminal", @@ -38,9 +38,6 @@ categories = ["command-line-interface"] license = "MIT" repository = "https://github.com/sunfishcode/is-terminal" -[dependencies.io-lifetimes] -version = "1.0.0" - [dev-dependencies.atty] version = "0.2.14" @@ -48,9 +45,13 @@ version = "0.2.14" version = "0.2.110" [target."cfg(not(any(windows, target_os = \"hermit\", target_os = \"unknown\")))".dependencies.rustix] -version = "0.37.0" +version = "0.38.0" features = ["termios"] +[target."cfg(not(any(windows, target_os = \"hermit\", target_os = \"unknown\")))".dev-dependencies.rustix] +version = "0.38.0" +features = ["stdio"] + [target."cfg(target_os = \"hermit\")".dependencies.hermit-abi] version = "0.3.0" diff --git a/vendor/is-terminal/README.md b/vendor/is-terminal/README.md index 081d93685..045ca9ee9 100644 --- a/vendor/is-terminal/README.md +++ b/vendor/is-terminal/README.md @@ -12,6 +12,11 @@ </p> </div> +As of Rust 1.70, most users should use the [`IsTerminal`] trait in the Rust +standard library instead of this crate. + +<hr> + is-terminal is a simple utility that answers one question: > Is this a terminal? @@ -94,7 +99,7 @@ stderr? false # Minimum Supported Rust Version (MSRV) This crate currently works on the version of [Rust on Debian stable], which is -currently Rust 1.48. This policy may change in the future, in minor version +currently Rust 1.63. This policy may change in the future, in minor version releases, so users using a fixed version of Rust should pin to a specific version of this crate. @@ -102,3 +107,4 @@ version of this crate. [the atty crate]: https://crates.io/crates/atty [I/O safety]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md [Rust on Debian stable]: https://packages.debian.org/stable/rust/rustc +[`IsTerminal`]: https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html diff --git a/vendor/is-terminal/src/lib.rs b/vendor/is-terminal/src/lib.rs index e363f14c1..e68e60ffa 100644 --- a/vendor/is-terminal/src/lib.rs +++ b/vendor/is-terminal/src/lib.rs @@ -27,14 +27,12 @@ #![cfg_attr(unix, no_std)] -#[cfg(not(target_os = "unknown"))] -use io_lifetimes::AsFilelike; -#[cfg(windows)] -use io_lifetimes::BorrowedHandle; +#[cfg(not(any(windows, target_os = "unknown")))] +use rustix::fd::AsFd; #[cfg(target_os = "hermit")] use std::os::hermit::io::AsRawFd; #[cfg(windows)] -use std::os::windows::io::AsRawHandle; +use std::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle}; #[cfg(windows)] use windows_sys::Win32::Foundation::HANDLE; @@ -67,12 +65,12 @@ pub trait IsTerminal { /// println!("stdout is a terminal") /// } /// ``` -pub fn is_terminal<T: IsTerminal>(this: &T) -> bool { +pub fn is_terminal<T: IsTerminal>(this: T) -> bool { this.is_terminal() } -#[cfg(not(target_os = "unknown"))] -impl<Stream: AsFilelike> IsTerminal for Stream { +#[cfg(not(any(windows, target_os = "unknown")))] +impl<Stream: AsFd> IsTerminal for Stream { #[inline] fn is_terminal(&self) -> bool { #[cfg(any(unix, target_os = "wasi"))] @@ -82,13 +80,16 @@ impl<Stream: AsFilelike> IsTerminal for Stream { #[cfg(target_os = "hermit")] { - hermit_abi::isatty(self.as_filelike().as_raw_fd()) + hermit_abi::isatty(self.as_fd().as_raw_fd()) } + } +} - #[cfg(windows)] - { - handle_is_console(self.as_filelike()) - } +#[cfg(windows)] +impl<Stream: AsHandle> IsTerminal for Stream { + #[inline] + fn is_terminal(&self) -> bool { + handle_is_console(self.as_handle()) } } @@ -313,7 +314,7 @@ mod tests { fn stdin() { assert_eq!( atty::is(atty::Stream::Stdin), - rustix::io::stdin().is_terminal() + rustix::stdio::stdin().is_terminal() ) } @@ -322,7 +323,7 @@ mod tests { fn stdout() { assert_eq!( atty::is(atty::Stream::Stdout), - rustix::io::stdout().is_terminal() + rustix::stdio::stdout().is_terminal() ) } @@ -331,7 +332,7 @@ mod tests { fn stderr() { assert_eq!( atty::is(atty::Stream::Stderr), - rustix::io::stderr().is_terminal() + rustix::stdio::stderr().is_terminal() ) } @@ -341,7 +342,7 @@ mod tests { unsafe { assert_eq!( libc::isatty(libc::STDIN_FILENO) != 0, - rustix::io::stdin().is_terminal() + rustix::stdio::stdin().is_terminal() ) } } @@ -352,7 +353,7 @@ mod tests { unsafe { assert_eq!( libc::isatty(libc::STDOUT_FILENO) != 0, - rustix::io::stdout().is_terminal() + rustix::stdio::stdout().is_terminal() ) } } @@ -363,7 +364,7 @@ mod tests { unsafe { assert_eq!( libc::isatty(libc::STDERR_FILENO) != 0, - rustix::io::stderr().is_terminal() + rustix::stdio::stderr().is_terminal() ) } } |