Skip to content

Commit

Permalink
switch rust-toolchain.toml to llvm-fb-15
Browse files Browse the repository at this point in the history
Reviewed By: dtolnay

Differential Revision: D52922775

fbshipit-source-id: 9e74a08f0ee21e8e5b158ef4096f7c60e4e78112
  • Loading branch information
diliop authored and facebook-github-bot committed Jan 22, 2024
1 parent 63b8e3c commit e59f193
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions detcore-model/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ impl Ord for DetTime {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for DetTime {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
let nanos = other.as_nanos();
Expand Down
1 change: 1 addition & 0 deletions detcore/src/dirents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Dirent64 {
}

// sort by name, but "." < ".." <= ..
#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for Dirent64 {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
if self.name.as_bytes()[..2] == b".\0"[..] {
Expand Down
2 changes: 1 addition & 1 deletion detcore/src/logdiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ fn diff_vecs(
Ok(false)
} else {
let mut diff_count = 0;
for (_ix, ((oix, ox), (_, oy))) in v1.iter().zip(v2.iter()).enumerate() {
for ((oix, ox), (_, oy)) in v1.iter().zip(v2.iter()) {
let (x, y) = if opts.strip_lines {
(strip_log_entry(ox), strip_log_entry(oy))
} else {
Expand Down
2 changes: 1 addition & 1 deletion detcore/src/preemptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ impl ThreadHistory {

/// Return the priority of the initial timeslice after the thread starts running.
pub fn initial_priority(&self) -> Priority {
if let Some((_ns, pr)) = self.prio_changes.get(0) {
if let Some((_ns, pr)) = self.prio_changes.first() {
*pr
} else {
self.final_prio
Expand Down
6 changes: 1 addition & 5 deletions detcore/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,11 +999,7 @@ impl Scheduler {
.next_turns
.get(dettid)
.expect("Missing next_turns entry");
let entry: &mut Vec<_> = self
.blocked
.futex_waiters
.entry(futexid)
.or_insert_with(Vec::new);
let entry: &mut Vec<_> = self.blocked.futex_waiters.entry(futexid).or_default();
entry.push((*dettid, nxt.resp.clone()));
// When we park, we use a resource request to signal WHAT we're blocking on. But this is
// not quite the same as when an active thread in the runqueue blocks on a resource, because
Expand Down
4 changes: 2 additions & 2 deletions detcore/src/scheduler/timed_waiters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl fmt::Display for TimedEvent {

impl TimedEvents {
pub fn insert(&mut self, ns: LogicalTime, dt: DetTid) {
let set = self.map.entry(ns).or_insert_with(BTreeSet::new);
let set = self.map.entry(ns).or_default();
if !set.insert(TimedEvent::ThreadEvt(dt)) {
panic!(
"TimedEvents::insert should not take a DetTid which is *already* in the set: {}",
Expand All @@ -72,7 +72,7 @@ impl TimedEvents {
let old = self.alarm_times.insert(dp, ns);
self.clear_old_alarm(old);

let set = self.map.entry(ns).or_insert_with(BTreeSet::new);
let set = self.map.entry(ns).or_default();
let evt = TimedEvent::AlarmEvt(dp, dt, sig);
if !set.insert(evt) {
panic!(
Expand Down
1 change: 0 additions & 1 deletion detcore/src/tool_global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@ impl GlobalState {
// TODO: eliminate this loop. Could instead signal with an ivar.
let response_ivar = loop {
tokio::task::yield_now().await;
let detpid = detpid;
let mut sched = self.sched.lock().unwrap();
// The resources that must be held for the fresh thread to run:
let rsrcs = {
Expand Down
4 changes: 1 addition & 3 deletions hermit-cli/src/bin/hermit/analyze/minimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,7 @@ impl AnalyzeOpts {
":: Knocked out only one preemption ({:?}), so concluding that one is critical.",
critical
);
let entry = critical_preempts
.entry(selected_tid)
.or_insert_with(BTreeSet::new);
let entry = critical_preempts.entry(selected_tid).or_default();

assert!(entry.insert(critical));
continue;
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
# @fb-only: path = "../../third-party-buck/platform010/build/rust/llvm-fb-12"
# @fb-only: path = "../../third-party-buck/platform010/build/rust/llvm-fb-15"
channel = "nightly" # @oss-only

0 comments on commit e59f193

Please sign in to comment.