Skip to content

Commit

Permalink
Fix rustc/clippy warnings
Browse files Browse the repository at this point in the history
Summary: Fixing CI to get better signal on the next diff.

Reviewed By: dtolnay

Differential Revision: D51630805

fbshipit-source-id: e86795c3ddf80d66369ddadc75b4ddc7b73f1d4e
  • Loading branch information
zertosh authored and facebook-github-bot committed Nov 28, 2023
1 parent eab3ea1 commit 8915569
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion detcore/src/logdiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ fn is_detlog_syscall_result(line: &str) -> bool {
// TODO:
// Append together a sequence of messages while truncating if there are too many.
fn _truncate_messages(_v: &[&str]) -> String {
todo!()
unimplemented!()
}

fn filter_infos<'a>(v: &[(usize, &'a str)]) -> Vec<(usize, &'a str)> {
Expand Down
2 changes: 1 addition & 1 deletion detcore/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ impl Scheduler {
.iter()
.map(|(ix, path)| (*ix, Some(vec[*ix as usize].clone()), path.clone()))
.collect();
let mut replayer = Replayer::new(vec.into_iter());
let mut replayer = Replayer::new(vec);
replayer.replay_exhausted_panic = cfg.replay_exhausted_panic;
replayer.die_on_desync = cfg.die_on_desync;
(Some(replayer), Some(toprint))
Expand Down
26 changes: 16 additions & 10 deletions detcore/src/tool_global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ impl GlobalState {
if self.cfg.virtualize_time {
let final_time = self.global_time.lock().unwrap();
let final_time_ns = final_time.as_nanos();
let epoch_ns = LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64);
#[allow(deprecated)] // FIXME! Deprecatd in chrono-0.4.31
let nanos = self.cfg.epoch.timestamp_nanos() as u64;
let epoch_ns = LogicalTime::from_nanos(nanos);
summary.virttime_final = final_time_ns.as_nanos();
summary.virttime_elapsed = if final_time_ns.as_nanos() >= epoch_ns.as_nanos() {
(final_time_ns - epoch_ns).as_nanos()
Expand Down Expand Up @@ -854,10 +856,13 @@ impl GlobalState {

async fn recv_determinize_inode(&self, from: Tid, ino: RawInode) -> (DetInode, LogicalTime) {
// Here we establish a policy that when we first see a file its mtime is epoch.
let (dino, ns) = self.inodes.lock().unwrap().add_inode(
ino,
LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64),
);
#[allow(deprecated)] // FIXME! Deprecatd in chrono-0.4.31
let nanos = self.cfg.epoch.timestamp_nanos() as u64;
let (dino, ns) = self
.inodes
.lock()
.unwrap()
.add_inode(ino, LogicalTime::from_nanos(nanos));
trace!(
"[detcore, dtid {}] resolved (raw) inode {:?} to {:?}, mtime {}",
from,
Expand All @@ -880,7 +885,9 @@ impl GlobalState {
// In this scenario, virtualize_metadata is set and virtualize_time isn't.
// We virtualize initial mtimes, but update using realtime.
let dt: DateTime<Utc> = Utc::now();
LogicalTime::from_nanos(dt.timestamp_nanos() as u64)
#[allow(deprecated)] // FIXME! Deprecatd in chrono-0.4.31
let nanos = dt.timestamp_nanos() as u64;
LogicalTime::from_nanos(nanos)
};
trace!(
"[dtid {}] bumping mtime on file (rawinode {:?}) to {}",
Expand All @@ -894,10 +901,9 @@ impl GlobalState {
} else {
// Otherwise we haven't seen this inode yet (e.g. because there hasnt been a
// stat on it), so we just-in-time add it.
let (d, _) = mg.add_inode(
ino,
LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64),
);
#[allow(deprecated)] // FIXME! Deprecatd in chrono-0.4.31
let nanos = self.cfg.epoch.timestamp_nanos() as u64;
let (d, _) = mg.add_inode(ino, LogicalTime::from_nanos(nanos));
d
};
let info = mg
Expand Down
4 changes: 2 additions & 2 deletions hermit-cli/src/bin/hermit/analyze/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,10 @@ impl AnalyzeOpts {
pub fn main(&mut self, global: &GlobalOpts) -> anyhow::Result<ExitStatus> {
// Not implemented yet:
if self.run1_schedule.is_some() {
todo!()
unimplemented!()
}
if self.run2_schedule.is_some() {
todo!()
unimplemented!()
}

self.phase0_initialize()?; // Need this early to set tmp_dir.
Expand Down
1 change: 1 addition & 0 deletions tests/rust/heap_ptrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

//! Test deterministic Rust heap allocation

#[allow(clippy::useless_vec)]
fn main() {
// Go far enough that we trigger an mmap directly for a big allocation.
// Interleaving print/alloc makes it easy to see which ones call mmap in an strace.
Expand Down

0 comments on commit 8915569

Please sign in to comment.