Skip to content

Commit

Permalink
Please clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 18, 2024
1 parent 23f65b6 commit c56efc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/concurrency/data_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,10 @@ impl AccessType {
}

fn is_retag(self) -> bool {
match self {
AccessType::NaRead(NaReadType::Retag) => true,
AccessType::NaWrite(NaWriteType::Retag) => true,
_ => false,
}
matches!(
self,
AccessType::NaRead(NaReadType::Retag) | AccessType::NaWrite(NaWriteType::Retag)
)
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,10 @@ pub fn report_error<'tcx, 'mir>(
if let Some(extra) = extra {
helps.push((None, format!("{extra}")));
helps.push((None, format!("see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model")));
} if *retag_explain {
}
if *retag_explain {
helps.push((None, "retags permit optimizations that insert speculative (or loop-hoisted) reads/writes. Therefore from the perspective of data races, a retag has the same implications as a read/write.".to_owned()));
}
}
helps.push((None, format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior")));
helps.push((None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")));
helps
Expand Down

0 comments on commit c56efc1

Please sign in to comment.