Fix broken-pipe-no-ice to not depend on unstable anonymous_pipe feature

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2025-02-24 20:02:44 +08:00 committed by Jieyou Xu
parent d47e5a371b
commit 224f287f32

View file

@ -11,12 +11,12 @@
// Internal Compiler Error strangely, but it doesn't even go through normal diagnostic infra. Very
// strange.
#![feature(anonymous_pipe)]
use std::io::Read;
use std::process::{Command, Stdio};
use run_make_support::env_var;
// FIXME(#137532): replace `os_pipe` dependency with std `anonymous_pipe` once that stabilizes and
// reaches beta.
use run_make_support::{env_var, os_pipe};
#[derive(Debug, PartialEq)]
enum Binary {
@ -25,7 +25,7 @@ enum Binary {
}
fn check_broken_pipe_handled_gracefully(bin: Binary, mut cmd: Command) {
let (reader, writer) = std::io::pipe().unwrap();
let (reader, writer) = os_pipe::pipe().unwrap();
drop(reader); // close read-end
cmd.stdout(writer).stderr(Stdio::piped());