Skip to content

Commit 185db15

Browse files
committed
Fixed formatting using rustfmt
1 parent fe670d9 commit 185db15

File tree

5 files changed

+20
-21
lines changed

5 files changed

+20
-21
lines changed

src/bin/miri.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,12 @@ fn main() {
323323
let action = match arg.strip_prefix("-Zmiri-isolated-op=").unwrap() {
324324
"hide" => miri::IsolatedOp::Reject(miri::RejectOpWith::NoWarning),
325325
"warn" => miri::IsolatedOp::Reject(miri::RejectOpWith::Warning),
326-
"warn-nobacktrace" => miri::IsolatedOp::Reject(miri::RejectOpWith::WarningWithoutBacktrace),
326+
"warn-nobacktrace" =>
327+
miri::IsolatedOp::Reject(miri::RejectOpWith::WarningWithoutBacktrace),
327328
"allow" => miri::IsolatedOp::Allow,
328-
_ => panic!("-Zmiri-isolated-op must be `hide`, `warn`, `warn-nobacktrace`, or `allow`"),
329-
329+
_ => panic!(
330+
"-Zmiri-isolated-op must be `hide`, `warn`, `warn-nobacktrace`, or `allow`"
331+
),
330332
};
331333
miri_config.isolated_op = action;
332334
}

src/diagnostics.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,22 +288,17 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
288288
CreatedCallId(id) => format!("function call with id {}", id),
289289
CreatedAlloc(AllocId(id)) => format!("created allocation with id {}", id),
290290
FreedAlloc(AllocId(id)) => format!("freed allocation with id {}", id),
291-
RejectedIsolatedOp(ref op) => format!("`{}` was made to return an error due to isolation", op),
291+
RejectedIsolatedOp(ref op) =>
292+
format!("`{}` was made to return an error due to isolation", op),
292293
};
293294

294295
let (title, diag_level) = match e {
295-
RejectedIsolatedOp(_) => ("operation rejected by isolation", DiagLevel::Warning),
296+
RejectedIsolatedOp(_) =>
297+
("operation rejected by isolation", DiagLevel::Warning),
296298
_ => ("tracking was triggered", DiagLevel::Note),
297299
};
298300

299-
report_msg(
300-
*this.tcx,
301-
diag_level,
302-
title,
303-
msg,
304-
vec![],
305-
&stacktrace,
306-
);
301+
report_msg(*this.tcx, diag_level, title, msg, vec![], &stacktrace);
307302
}
308303
});
309304
}

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ pub use crate::diagnostics::{
5757
register_diagnostic, report_error, EvalContextExt as DiagnosticsEvalContextExt,
5858
NonHaltingDiagnostic, TerminationInfo,
5959
};
60-
pub use crate::eval::{create_ecx, eval_main, AlignmentCheck, IsolatedOp, MiriConfig, RejectOpWith};
60+
pub use crate::eval::{
61+
create_ecx, eval_main, AlignmentCheck, IsolatedOp, MiriConfig, RejectOpWith,
62+
};
6163
pub use crate::helpers::EvalContextExt as HelpersEvalContextExt;
6264
pub use crate::machine::{
6365
AllocExtra, Evaluator, FrameData, MemoryExtra, MiriEvalContext, MiriEvalContextExt,

src/machine.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,7 @@ pub struct Evaluator<'mir, 'tcx> {
278278
}
279279

280280
impl<'mir, 'tcx> Evaluator<'mir, 'tcx> {
281-
pub(crate) fn new(
282-
config: &MiriConfig,
283-
layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>,
284-
) -> Self {
281+
pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Self {
285282
let layouts =
286283
PrimitiveLayouts::new(layout_cx).expect("Couldn't get layouts of primitive types");
287284
Evaluator {

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)