diff --git a/crates/red_knot/src/main.rs b/crates/red_knot/src/main.rs index 297cecce5aa1f..5d1a7c79e2987 100644 --- a/crates/red_knot/src/main.rs +++ b/crates/red_knot/src/main.rs @@ -1,10 +1,8 @@ #![allow(clippy::dbg_macro)] use std::collections::hash_map::Entry; -use std::num::NonZeroUsize; use std::path::Path; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use rustc_hash::FxHashMap; use tracing::subscriber::Interest; diff --git a/crates/red_knot/src/program/check.rs b/crates/red_knot/src/program/check.rs index 9edf12072243a..323d877547c0c 100644 --- a/crates/red_knot/src/program/check.rs +++ b/crates/red_knot/src/program/check.rs @@ -78,7 +78,7 @@ pub struct RayonCheckScheduler<'program, 'scope_ref, 'scope> { impl<'program, 'scope_ref, 'scope> RayonCheckScheduler<'program, 'scope_ref, 'scope> { pub fn new(program: &'program Program, scope: &'scope_ref rayon::Scope<'scope>) -> Self { - Self { scope, program } + Self { program, scope } } } @@ -117,7 +117,7 @@ impl<'a> SameThreadCheckScheduler<'a> { impl CheckScheduler for SameThreadCheckScheduler<'_> { fn check_file(&self, task: CheckFileTask) { - task.run(self.program) + task.run(self.program); } fn max_concurrency(&self) -> Option { @@ -166,8 +166,8 @@ impl CheckContext { sender: crossbeam_channel::Sender, ) -> Self { Self { - sender, cancellation_token, + sender, } } @@ -224,13 +224,13 @@ impl<'a> CheckFilesLoop<'a> { self.queue_file(file, context.clone())?; } - self.run_impl(receiver, context) + self.run_impl(receiver, &context) } fn run_impl( mut self, receiver: crossbeam_channel::Receiver, - context: CheckContext, + context: &CheckContext, ) -> Result, CheckError> { if self.cancellation_token.is_cancelled() { return Err(CheckError::Cancelled);