mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
Rollup merge of #118399 - mu001999:miri/cleanup, r=RalfJung
Clean dead codes in miri Detected by #118257
This commit is contained in:
commit
71b29e8a38
@ -66,11 +66,6 @@ pub trait FileDescriptor: std::fmt::Debug + Any {
|
||||
fn is_tty(&self, _communicate_allowed: bool) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn as_unix_host_fd(&self) -> Option<i32> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl dyn FileDescriptor {
|
||||
@ -150,12 +145,6 @@ impl FileDescriptor for FileHandle {
|
||||
Ok(Box::new(FileHandle { file: duplicated, writable: self.writable }))
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn as_unix_host_fd(&self) -> Option<i32> {
|
||||
use std::os::unix::io::AsRawFd;
|
||||
Some(self.file.as_raw_fd())
|
||||
}
|
||||
|
||||
fn is_tty(&self, communicate_allowed: bool) -> bool {
|
||||
communicate_allowed && self.file.is_terminal()
|
||||
}
|
||||
@ -183,11 +172,6 @@ impl FileDescriptor for io::Stdin {
|
||||
Ok(Box::new(io::stdin()))
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn as_unix_host_fd(&self) -> Option<i32> {
|
||||
Some(libc::STDIN_FILENO)
|
||||
}
|
||||
|
||||
fn is_tty(&self, communicate_allowed: bool) -> bool {
|
||||
communicate_allowed && self.is_terminal()
|
||||
}
|
||||
@ -220,11 +204,6 @@ impl FileDescriptor for io::Stdout {
|
||||
Ok(Box::new(io::stdout()))
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn as_unix_host_fd(&self) -> Option<i32> {
|
||||
Some(libc::STDOUT_FILENO)
|
||||
}
|
||||
|
||||
fn is_tty(&self, communicate_allowed: bool) -> bool {
|
||||
communicate_allowed && self.is_terminal()
|
||||
}
|
||||
@ -250,11 +229,6 @@ impl FileDescriptor for io::Stderr {
|
||||
Ok(Box::new(io::stderr()))
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn as_unix_host_fd(&self) -> Option<i32> {
|
||||
Some(libc::STDERR_FILENO)
|
||||
}
|
||||
|
||||
fn is_tty(&self, communicate_allowed: bool) -> bool {
|
||||
communicate_allowed && self.is_terminal()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user