Skip to content

Commit a52e169

Browse files
authored
Update rust-toolchain to nightly-2023-10-06 (vercel/turborepo#6128)
This: - Updates rust-toolchain to nightly-2023-10-06 - Removes allowing clippy rules for needless_pass_by_ref_mut and non_canonical_partial_ord_impl as the linked issues appear to have been resolved in [0] and [1] respectively - Fixes apparently legitimate issues now reported by clippy Test Plan: CI [0] rust-lang/rust-clippy#11492 [1] rust-lang/rust-clippy#11188 Closes WEB-1732
1 parent 093af18 commit a52e169

File tree

12 files changed

+17
-23
lines changed

12 files changed

+17
-23
lines changed

crates/turbo-tasks-memory/src/aggregation_tree/bottom_tree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl<T, I: Clone + Eq + Hash + IsEnabled> BottomTree<T, I> {
555555
) {
556556
let mut state = self.state.write();
557557
let change = aggregation_context.apply_change(&mut state.data, change);
558-
propagate_change_to_upper(&mut state, aggregation_context, change);
558+
propagate_change_to_upper(&state, aggregation_context, change);
559559
}
560560

561561
pub fn get_root_info<C: AggregationContext<Info = T, ItemRef = I>>(
@@ -627,7 +627,7 @@ fn propagate_new_following_to_uppers<C: AggregationContext>(
627627
}
628628

629629
fn propagate_change_to_upper<C: AggregationContext>(
630-
state: &mut RwLockWriteGuard<BottomTreeState<C::Info, C::ItemRef>>,
630+
state: &RwLockWriteGuard<BottomTreeState<C::Info, C::ItemRef>>,
631631
aggregation_context: &C,
632632
change: Option<C::ItemChange>,
633633
) {

crates/turbo-tasks-memory/src/aggregation_tree/top_tree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<T> TopTree<T> {
111111
) {
112112
let mut state = self.state.lock();
113113
let change = aggregation_context.apply_change(&mut state.data, change);
114-
propagate_change_to_upper(&mut state, aggregation_context, change);
114+
propagate_change_to_upper(&state, aggregation_context, change);
115115
}
116116

117117
pub fn get_root_info<C: AggregationContext<Info = T>>(
@@ -147,7 +147,7 @@ impl<T> TopTree<T> {
147147
}
148148

149149
fn propagate_change_to_upper<C: AggregationContext>(
150-
state: &mut MutexGuard<TopTreeState<C::Info>>,
150+
state: &MutexGuard<TopTreeState<C::Info>>,
151151
aggregation_context: &C,
152152
change: Option<C::ItemChange>,
153153
) {

crates/turbo-tasks/src/magic_any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Eq for dyn MagicAny {}
9090

9191
impl PartialOrd for dyn MagicAny {
9292
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
93-
Some(self.magic_cmp(other))
93+
Some(self.cmp(other))
9494
}
9595
}
9696

crates/turbo-tasks/src/native_function.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ impl Hash for &'static NativeFunction {
9191

9292
impl PartialOrd for &'static NativeFunction {
9393
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
94-
PartialOrd::partial_cmp(
95-
&(*self as *const NativeFunction),
96-
&(*other as *const NativeFunction),
97-
)
94+
Some(self.cmp(other))
9895
}
9996
}
10097
impl Ord for &'static NativeFunction {

crates/turbo-tasks/src/task/concrete_task_input.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ impl PartialEq for SharedReference {
4747
impl Eq for SharedReference {}
4848
impl PartialOrd for SharedReference {
4949
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
50-
PartialOrd::partial_cmp(
51-
&(&*self.1 as *const (dyn Any + Send + Sync)),
52-
&(&*other.1 as *const (dyn Any + Send + Sync)),
53-
)
50+
Some(self.cmp(other))
5451
}
5552
}
5653
impl Ord for SharedReference {

crates/turbo-tasks/src/trait_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<T> Eq for TraitRef<T> {}
4949

5050
impl<T> PartialOrd for TraitRef<T> {
5151
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
52-
self.shared_reference.partial_cmp(&other.shared_reference)
52+
Some(self.cmp(other))
5353
}
5454
}
5555

crates/turbo-tasks/src/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<T> std::hash::Hash for TransientInstance<T> {
100100

101101
impl<T> PartialOrd for TransientInstance<T> {
102102
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
103-
self.inner.partial_cmp(&other.inner)
103+
Some(self.cmp(other))
104104
}
105105
}
106106

crates/turbo-tasks/src/value_type.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl PartialEq for ValueType {
5858

5959
impl PartialOrd for ValueType {
6060
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
61-
(self as *const ValueType).partial_cmp(&(other as *const ValueType))
61+
Some(self.cmp(other))
6262
}
6363
}
6464
impl Ord for ValueType {
@@ -225,7 +225,7 @@ impl PartialEq for TraitType {
225225

226226
impl PartialOrd for TraitType {
227227
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
228-
(self as *const TraitType).partial_cmp(&(other as *const TraitType))
228+
Some(self.cmp(other))
229229
}
230230
}
231231

crates/turbo-tasks/src/vc/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ where
230230
T: ?Sized + Send,
231231
{
232232
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
233-
self.node.partial_cmp(&other.node)
233+
Some(self.cmp(other))
234234
}
235235
}
236236

crates/turbopack-core/src/chunk/containment_tree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ where
4747

4848
let orphan_values = Self::add_values_to_tree(&mut trees, values);
4949

50-
let roots = Self::treeify(relationships, &mut trees);
50+
let roots = Self::treeify(relationships, &trees);
5151

5252
// optimize tree by removing unnecessary nodes
5353
Self::skip_unnecessary_nodes(&mut trees);
@@ -146,7 +146,7 @@ where
146146
/// Nest each tree by relationship, compute the roots
147147
fn treeify(
148148
relationships: Vec<(Option<K>, K)>,
149-
trees: &mut IndexMap<K, Rc<RefCell<Node<K, V>>>>,
149+
trees: &IndexMap<K, Rc<RefCell<Node<K, V>>>>,
150150
) -> Vec<Rc<RefCell<Node<K, V>>>> {
151151
relationships
152152
.into_iter()

crates/turbopack-dev/src/ecmascript/optimize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ async fn merge_duplicated_and_contained(
139139

140140
impl PartialOrd for FloatOrd {
141141
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
142-
self.0.partial_cmp(&other.0)
142+
Some(self.cmp(other))
143143
}
144144
}
145145
impl Ord for FloatOrd {
146146
fn cmp(&self, other: &Self) -> Ordering {
147-
self.partial_cmp(other).unwrap_or(Ordering::Equal)
147+
self.0.partial_cmp(&other.0).unwrap_or(Ordering::Equal)
148148
}
149149
}
150150

crates/turbopack-ecmascript/src/analyzer/graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ impl<'a> Analyzer<'a> {
16441644
fn add_conditional_effect(
16451645
&mut self,
16461646
test: &Expr,
1647-
ast_path: &mut AstNodePath<AstParentNodeRef<'_>>,
1647+
ast_path: &AstNodePath<AstParentNodeRef<'_>>,
16481648
ast_kind: AstParentKind,
16491649
span: Span,
16501650
mut cond_kind: ConditionalKind,

0 commit comments

Comments
 (0)