Skip to content

Commit eea6739

Browse files
committed
Fixed formatting using rustfmt
1 parent ed2104b commit eea6739

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

src/bin/miri.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,12 @@ fn main() {
390390
let action = match arg.strip_prefix("-Zmiri-isolated-op=").unwrap() {
391391
"hide" => miri::IsolatedOp::Reject(miri::RejectOpWith::NoWarning),
392392
"warn" => miri::IsolatedOp::Reject(miri::RejectOpWith::Warning),
393-
"warn-nobacktrace" => miri::IsolatedOp::Reject(miri::RejectOpWith::WarningWithoutBacktrace),
393+
"warn-nobacktrace" =>
394+
miri::IsolatedOp::Reject(miri::RejectOpWith::WarningWithoutBacktrace),
394395
"allow" => miri::IsolatedOp::Allow,
395-
_ => panic!("-Zmiri-isolated-op must be `hide`, `warn`, `warn-nobacktrace`, or `allow`"),
396-
396+
_ => panic!(
397+
"-Zmiri-isolated-op must be `hide`, `warn`, `warn-nobacktrace`, or `allow`"
398+
),
397399
};
398400
miri_config.isolated_op = action;
399401
}

src/diagnostics.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,22 +312,17 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
312312
CreatedCallId(id) => format!("function call with id {}", id),
313313
CreatedAlloc(AllocId(id)) => format!("created allocation with id {}", id),
314314
FreedAlloc(AllocId(id)) => format!("freed allocation with id {}", id),
315-
RejectedIsolatedOp(ref op) => format!("`{}` was made to return an error due to isolation", op),
315+
RejectedIsolatedOp(ref op) =>
316+
format!("`{}` was made to return an error due to isolation", op),
316317
};
317318

318319
let (title, diag_level) = match e {
319-
RejectedIsolatedOp(_) => ("operation rejected by isolation", DiagLevel::Warning),
320+
RejectedIsolatedOp(_) =>
321+
("operation rejected by isolation", DiagLevel::Warning),
320322
_ => ("tracking was triggered", DiagLevel::Note),
321323
};
322324

323-
report_msg(
324-
*this.tcx,
325-
diag_level,
326-
title,
327-
msg,
328-
vec![],
329-
&stacktrace,
330-
);
325+
report_msg(*this.tcx, diag_level, title, msg, vec![], &stacktrace);
331326
}
332327
});
333328
}

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ pub use crate::diagnostics::{
5959
register_diagnostic, report_error, EvalContextExt as DiagnosticsEvalContextExt,
6060
NonHaltingDiagnostic, TerminationInfo,
6161
};
62-
pub use crate::eval::{create_ecx, eval_main, AlignmentCheck, IsolatedOp, MiriConfig, RejectOpWith};
62+
pub use crate::eval::{
63+
create_ecx, eval_main, AlignmentCheck, IsolatedOp, MiriConfig, RejectOpWith,
64+
};
6365
pub use crate::helpers::EvalContextExt as HelpersEvalContextExt;
6466
pub use crate::machine::{
6567
AllocExtra, Evaluator, FrameData, MemoryExtra, MiriEvalContext, MiriEvalContextExt,

src/shims/env.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
355355
) -> InterpResult<'tcx, u32> {
356356
let this = self.eval_context_mut();
357357
this.assert_target_os("windows", "GetCurrentDirectoryW");
358-
358+
359359
match this.machine.isolated_op {
360360
IsolatedOp::Allow => {
361361
let size = u64::from(this.read_scalar(size_op)?.to_u32()?);
@@ -364,7 +364,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
364364
// If we cannot get the current directory, we return 0
365365
match env::current_dir() {
366366
Ok(cwd) =>
367-
return Ok(windows_check_buffer_size(this.write_path_to_wide_str(&cwd, buf, size)?)),
367+
return Ok(windows_check_buffer_size(
368+
this.write_path_to_wide_str(&cwd, buf, size)?,
369+
)),
368370
Err(e) => this.set_last_error_from_io_error(e)?,
369371
}
370372
}
@@ -419,7 +421,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
419421

420422
match this.machine.isolated_op {
421423
IsolatedOp::Allow => {
422-
let path = this.read_path_from_wide_str(this.read_scalar(path_op)?.check_init()?)?;
424+
let path =
425+
this.read_path_from_wide_str(this.read_scalar(path_op)?.check_init()?)?;
423426

424427
match env::set_current_dir(path) {
425428
Ok(()) => Ok(1),

0 commit comments

Comments
 (0)