-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a command line flag to avoid printing to stdout and stderr #2084
Conversation
Does this add a command line flag? Or just another |
Those are the same thing? MIRIFLAGS is how you pass command line flags to the Miri driver when using the cargo wrapper. |
Ah. I have only ever used the Cargo wrapper, this whole "Miri driver" thing is just something I hear you mention 😅 |
r=me with the last 2 nits fixed. :) |
@bors r=RalfJung |
📌 Commit 6dc6256 has been approved by |
☀️ Test successful - checks-actions |
impl<'tcx> Default for FileHandler { | ||
fn default() -> Self { | ||
impl<'tcx> FileHandler { | ||
pub(crate) fn new(drop_stdout_stderr: bool) -> FileHandler { | ||
let mut handles: BTreeMap<_, Box<dyn FileDescriptor>> = BTreeMap::new(); | ||
handles.insert(0i32, Box::new(io::stdin())); | ||
handles.insert(1i32, Box::new(io::stdout())); | ||
if drop_stdout_stderr { | ||
handles.insert(0i32, Box::new(DevNull)); | ||
handles.insert(1i32, Box::new(DevNull)); | ||
} else { | ||
handles.insert(0i32, Box::new(io::stdin())); | ||
handles.insert(1i32, Box::new(io::stdout())); | ||
} | ||
handles.insert(2i32, Box::new(io::stderr())); | ||
FileHandler { handles } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaa dammit
This is practical for tests that don't actually care about the output and thus don't want it intermingled with miri's warnings, errors or ICEs
fixes #2083