Skip to content

Commit 431df76

Browse files
committed
cargo-fmt for 2024 edition
1 parent b92f9a1 commit 431df76

41 files changed

Lines changed: 623 additions & 555 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/cli/concolic_explore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
ir::{Location, ModuleSpec},
32
HashSet,
3+
ir::{Location, ModuleSpec},
44
};
55
use std::{cell::RefCell, collections::VecDeque, rc::Rc, sync::Arc};
66

@@ -202,7 +202,7 @@ impl<'a> ConcolicExplorer<'a> {
202202
for (event_idx, event) in trace.events.iter().enumerate() {
203203
// TODO: what about other events?
204204
dbg!(event);
205-
if let ConcolicEvent::PathConstraint { .. } = *event {
205+
if let ConcolicEvent::PathConstraint { .. } = *event {
206206
// if location == loc || true { // TODO
207207
self.wq.push_back(Work::CheckSatNoConstraints {
208208
trace_idx,

src/cli/cov_html.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::HashMap;
12
use crate::instrumentation::BBCoveragePass;
23
use crate::ir::debuginfo_helper::resolve_source_location;
3-
use crate::HashMap;
44
use std::collections::BTreeSet;
55
use std::fmt::Write;
66
use std::path::PathBuf;
@@ -11,10 +11,10 @@ use clap::Parser;
1111
use askama::Template;
1212
use symbolic::debuginfo::{Object, ObjectError};
1313
use syntect::highlighting::ThemeSet;
14-
use syntect::html::{css_for_theme_with_class_style, ClassStyle};
14+
use syntect::html::{ClassStyle, css_for_theme_with_class_style};
1515
use syntect::parsing::{
16-
BasicScopeStackOp, ParseState, Scope, ScopeRepository, ScopeStack, SyntaxReference, SyntaxSet,
17-
SCOPE_REPO,
16+
BasicScopeStackOp, ParseState, SCOPE_REPO, Scope, ScopeRepository, ScopeStack, SyntaxReference,
17+
SyntaxSet,
1818
};
1919
use syntect::util::LinesWithEndings;
2020

src/cli/lcov.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// this suggest that high line coverage accuracy should be possible for -O0 (fig 10):
33
// https://arxiv.org/abs/2402.04811v1
44

5-
use crate::instrumentation::BBCoveragePass;
65
use crate::HashMap;
6+
use crate::instrumentation::BBCoveragePass;
77
use std::path::PathBuf;
88
use std::sync::Arc;
99

src/cli/monitor_cov.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::{
2+
HashSet,
23
instrumentation::{
34
BBCoveragePass, CodeCovInstrumentationPass, EdgeCoveragePass, FunctionCoveragePass,
45
},
5-
HashSet,
66
};
77
use std::{
88
io::Write,

src/concolic/bitwuzla_backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// TODO(concolic): concretization policies in style of https://github.com/trailofbits/manticore/blob/master/manticore/core/state.py#L387
22

3-
use crate::{ir::ModuleSpec, HashMap, HashSet};
3+
use crate::{HashMap, HashSet, ir::ModuleSpec};
44
use std::{rc::Rc, sync::Arc, time::Duration};
55

66
use bitvec::slice::BitSlice;
7-
use bitwuzla::{Bool, Btor, RoundingMode, SolverResult, BV, FP};
7+
use bitwuzla::{BV, Bool, Btor, FP, RoundingMode, SolverResult};
88

99
use crate::concolic::MemoryAccessKind;
1010

src/concolic/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl MemoryAccessKind {
342342
opcode: cranelift::codegen::ir::Opcode,
343343
ty: cranelift::prelude::Type,
344344
) -> Self {
345-
use cranelift::codegen::ir::{types, Opcode};
345+
use cranelift::codegen::ir::{Opcode, types};
346346
match (opcode, ty) {
347347
(Opcode::Load, types::I32) => Self::I32,
348348
(Opcode::Load, types::I64) => Self::I64,

src/concolic/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use speedy::{Readable, Writable};
22

33
use crate::ir::{
4-
operators::{ConversionOp, FRelOp},
54
FBinaryOp, FUnaryOp, IBinaryOp, IRelOp, ITestOp, IUnaryOp,
5+
operators::{ConversionOp, FRelOp},
66
};
77

88
#[derive(Debug, Clone, Hash, PartialEq, Eq, Readable, Writable)]

src/concolic/smtlib_backend.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{ir::ModuleSpec, HashMap, HashSet};
1+
use crate::{HashMap, HashSet, ir::ModuleSpec};
22
use std::sync::Arc;
33

44
use crate::concolic::MemoryAccessKind;
@@ -8,9 +8,9 @@ use super::{BinaryOp, ConcolicEvent, SolverBackendError, SymVal, SymValRef, Symv
88

99
use smtlib::Logic;
1010
use smtlib::{
11+
BitVec, Bool, SatResult,
1112
prelude::*,
1213
terms::{Const, Dynamic},
13-
BitVec, Bool, SatResult,
1414
};
1515

1616
#[derive(Clone, Debug)]
@@ -134,12 +134,10 @@ impl<'ctx> SolverInstance<'ctx> {
134134
}
135135

136136
fn get_inp_bv(&mut self, i: u16) -> Const<'ctx, BitVec<'ctx, 8>> {
137-
*self.inp_vals
138-
.entry(i)
139-
.or_insert_with(|| {
140-
let symbol = format!("inp-{i}");
141-
BitVec::new_const(self.storage, &symbol)
142-
})
137+
*self.inp_vals.entry(i).or_insert_with(|| {
138+
let symbol = format!("inp-{i}");
139+
BitVec::new_const(self.storage, &symbol)
140+
})
143141
}
144142

145143
fn new_prop(&mut self) -> Const<'ctx, Bool<'ctx>> {
@@ -193,7 +191,7 @@ impl<'ctx> SolverInstance<'ctx> {
193191
SymVal::ConstI32(v) => BitVec::<32>::new(self.storage, v as i64).into(),
194192
SymVal::ConstI64(v) => BitVec::<64>::new(self.storage, v as i64).into(),
195193
SymVal::ConstF32(_) | SymVal::ConstF64(_) => {
196-
return Err(SolverBackendError::UnsupportedFloatingpointOperation)
194+
return Err(SolverBackendError::UnsupportedFloatingpointOperation);
197195
}
198196
SymVal::Unary(op, bv) => {
199197
let val = self.get_symval(bv, context)?;
@@ -268,7 +266,7 @@ impl<'ctx> SolverInstance<'ctx> {
268266
MemoryAccessKind::I64AsS32 => combine_32(&bytes).sext::<32, 64>().into(),
269267
MemoryAccessKind::I64AsU32 => combine_32(&bytes).uext::<32, 64>().into(),
270268
MemoryAccessKind::F32 | MemoryAccessKind::F64 => {
271-
return Err(SolverBackendError::UnsupportedFloatingpointOperation)
269+
return Err(SolverBackendError::UnsupportedFloatingpointOperation);
272270
}
273271
}
274272
// zero-width bvs are not allowed :(

src/concolic/z3_backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::sync::Arc;
33

44
use bitvec::slice::BitSlice;
55
use z3::{
6-
ast::{Ast, Bool, Dynamic, Float, BV},
76
SatResult, Solver, Symbol,
7+
ast::{Ast, BV, Bool, Dynamic, Float},
88
};
99

1010
use crate::{concolic::MemoryAccessKind, ir::ModuleSpec};

src/fuzzer/exhaustive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rand::{seq::SliceRandom, Rng};
1+
use rand::{Rng, seq::SliceRandom};
22

33
pub trait QueuedInputMutation {
44
fn input(&self) -> &[u8];

0 commit comments

Comments
 (0)