Skip to content

Commit

Permalink
Update rust-toolchain to nightly-2023-10-06 (#6128)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wbinnssmith authored Oct 10, 2023
1 parent b9384c5 commit b3f79b1
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 29 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@ rustflags = [
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
# Clippy's needless mut lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11299
"-Aclippy::needless_pass_by_ref_mut",
# Clippy's partial_eq lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11178
"-Aclippy::non_canonical_partial_ord_impl",
]
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ jobs:

- name: Run cargo clippy
run: |
RUSTFLAGS="-D warnings -A deprecated -Aclippy::too_many_arguments -Aclippy::needless_pass_by_ref_mut -Aclippy::non_canonical_partial_ord_impl" cargo groups clippy turbopack --features rustls-tls
RUSTFLAGS="-D warnings -A deprecated -Aclippy::too_many_arguments" cargo groups clippy turbopack --features rustls-tls
- name: Run ast-grep lints
run: |
Expand Down
4 changes: 2 additions & 2 deletions crates/turbo-tasks-memory/src/aggregation_tree/bottom_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl<T, I: Clone + Eq + Hash + IsEnabled> BottomTree<T, I> {
) {
let mut state = self.state.write();
let change = aggregation_context.apply_change(&mut state.data, change);
propagate_change_to_upper(&mut state, aggregation_context, change);
propagate_change_to_upper(&state, aggregation_context, change);
}

pub fn get_root_info<C: AggregationContext<Info = T, ItemRef = I>>(
Expand Down Expand Up @@ -627,7 +627,7 @@ fn propagate_new_following_to_uppers<C: AggregationContext>(
}

fn propagate_change_to_upper<C: AggregationContext>(
state: &mut RwLockWriteGuard<BottomTreeState<C::Info, C::ItemRef>>,
state: &RwLockWriteGuard<BottomTreeState<C::Info, C::ItemRef>>,
aggregation_context: &C,
change: Option<C::ItemChange>,
) {
Expand Down
4 changes: 2 additions & 2 deletions crates/turbo-tasks-memory/src/aggregation_tree/top_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl<T> TopTree<T> {
) {
let mut state = self.state.lock();
let change = aggregation_context.apply_change(&mut state.data, change);
propagate_change_to_upper(&mut state, aggregation_context, change);
propagate_change_to_upper(&state, aggregation_context, change);
}

pub fn get_root_info<C: AggregationContext<Info = T>>(
Expand Down Expand Up @@ -147,7 +147,7 @@ impl<T> TopTree<T> {
}

fn propagate_change_to_upper<C: AggregationContext>(
state: &mut MutexGuard<TopTreeState<C::Info>>,
state: &MutexGuard<TopTreeState<C::Info>>,
aggregation_context: &C,
change: Option<C::ItemChange>,
) {
Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks/src/magic_any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Eq for dyn MagicAny {}

impl PartialOrd for dyn MagicAny {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.magic_cmp(other))
Some(self.cmp(other))
}
}

Expand Down
5 changes: 1 addition & 4 deletions crates/turbo-tasks/src/native_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ impl Hash for &'static NativeFunction {

impl PartialOrd for &'static NativeFunction {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
PartialOrd::partial_cmp(
&(*self as *const NativeFunction),
&(*other as *const NativeFunction),
)
Some(self.cmp(other))
}
}
impl Ord for &'static NativeFunction {
Expand Down
5 changes: 1 addition & 4 deletions crates/turbo-tasks/src/task/concrete_task_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ impl PartialEq for SharedReference {
impl Eq for SharedReference {}
impl PartialOrd for SharedReference {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
PartialOrd::partial_cmp(
&(&*self.1 as *const (dyn Any + Send + Sync)),
&(&*other.1 as *const (dyn Any + Send + Sync)),
)
Some(self.cmp(other))
}
}
impl Ord for SharedReference {
Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks/src/trait_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<T> Eq for TraitRef<T> {}

impl<T> PartialOrd for TraitRef<T> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.shared_reference.partial_cmp(&other.shared_reference)
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<T> std::hash::Hash for TransientInstance<T> {

impl<T> PartialOrd for TransientInstance<T> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.inner.partial_cmp(&other.inner)
Some(self.cmp(other))
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/turbo-tasks/src/value_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl PartialEq for ValueType {

impl PartialOrd for ValueType {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
(self as *const ValueType).partial_cmp(&(other as *const ValueType))
Some(self.cmp(other))
}
}
impl Ord for ValueType {
Expand Down Expand Up @@ -225,7 +225,7 @@ impl PartialEq for TraitType {

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

Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks/src/vc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ where
T: ?Sized + Send,
{
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.node.partial_cmp(&other.node)
Some(self.cmp(other))
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/turbopack-core/src/chunk/containment_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where

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

let roots = Self::treeify(relationships, &mut trees);
let roots = Self::treeify(relationships, &trees);

// optimize tree by removing unnecessary nodes
Self::skip_unnecessary_nodes(&mut trees);
Expand Down Expand Up @@ -146,7 +146,7 @@ where
/// Nest each tree by relationship, compute the roots
fn treeify(
relationships: Vec<(Option<K>, K)>,
trees: &mut IndexMap<K, Rc<RefCell<Node<K, V>>>>,
trees: &IndexMap<K, Rc<RefCell<Node<K, V>>>>,
) -> Vec<Rc<RefCell<Node<K, V>>>> {
relationships
.into_iter()
Expand Down
4 changes: 2 additions & 2 deletions crates/turbopack-dev/src/ecmascript/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ async fn merge_duplicated_and_contained(

impl PartialOrd for FloatOrd {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}
impl Ord for FloatOrd {
fn cmp(&self, other: &Self) -> Ordering {
self.partial_cmp(other).unwrap_or(Ordering::Equal)
self.0.partial_cmp(&other.0).unwrap_or(Ordering::Equal)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-ecmascript/src/analyzer/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ impl<'a> Analyzer<'a> {
fn add_conditional_effect(
&mut self,
test: &Expr,
ast_path: &mut AstNodePath<AstParentNodeRef<'_>>,
ast_path: &AstNodePath<AstParentNodeRef<'_>>,
ast_kind: AstParentKind,
span: Span,
mut cond_kind: ConditionalKind,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-09-21
nightly-2023-10-06

0 comments on commit b3f79b1

Please sign in to comment.