parent
d7d7a9a162
commit
89da571b5d
@ -307,14 +307,14 @@ pub struct FileHandler {
|
||||
impl<'tcx> FileHandler {
|
||||
pub(crate) fn new(mute_stdout_stderr: bool) -> FileHandler {
|
||||
let mut handles: BTreeMap<_, Box<dyn FileDescriptor>> = BTreeMap::new();
|
||||
handles.insert(0i32, Box::new(io::stdin()));
|
||||
if mute_stdout_stderr {
|
||||
handles.insert(0i32, Box::new(DummyOutput));
|
||||
handles.insert(1i32, Box::new(DummyOutput));
|
||||
handles.insert(2i32, Box::new(DummyOutput));
|
||||
} else {
|
||||
handles.insert(0i32, Box::new(io::stdin()));
|
||||
handles.insert(1i32, Box::new(io::stdout()));
|
||||
handles.insert(2i32, Box::new(io::stderr()));
|
||||
}
|
||||
handles.insert(2i32, Box::new(io::stderr()));
|
||||
FileHandler { handles }
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
// compile-flags: -Zmiri-mute-stdout-stderr
|
||||
|
||||
fn main() {
|
||||
println!("cake");
|
||||
println!("print to stdout");
|
||||
eprintln!("print to stderr");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user