Remove PartialOrd, Ord implementations from keys

They do not have a clear ordering so we shouldn't expose such
This commit is contained in:
Lukas Wirth 2025-01-05 10:42:04 +01:00
parent 613fade99f
commit 189fc09055
3 changed files with 6 additions and 6 deletions

View file

@ -16,7 +16,7 @@ use std::{panic::AssertUnwindSafe, sync::Arc};
///
/// You can read more about cycle handling in
/// the [salsa book](https://https://salsa-rs.github.io/salsa/cycles.html).
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct Cycle {
participants: CycleParticipants,
}

View file

@ -6,7 +6,7 @@ use crate::{cycle::CycleRecoveryStrategy, zalsa::IngredientIndex, Database, Id};
/// database. Used to track output dependencies between queries. Fully ordered and
/// equatable but those orderings are arbitrary, and meant to be used only for
/// inserting into maps and the like.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub struct OutputDependencyIndex {
ingredient_index: IngredientIndex,
key_index: Id,
@ -16,7 +16,7 @@ pub struct OutputDependencyIndex {
/// database. Used to track input dependencies between queries. Fully ordered and
/// equatable but those orderings are arbitrary, and meant to be used only for
/// inserting into maps and the like.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub struct InputDependencyIndex {
ingredient_index: IngredientIndex,
key_index: Option<Id>,
@ -116,7 +116,7 @@ impl fmt::Debug for InputDependencyIndex {
/// An "active" database key index represents a database key index
/// that is actively executing. In that case, the `key_index` cannot be
/// None.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub struct DatabaseKeyIndex {
pub(crate) ingredient_index: IngredientIndex,
pub(crate) key_index: Id,

View file

@ -274,10 +274,10 @@ impl Runtime {
// no matter where it started on the stack. Find the minimum
// key and rotate it to the front.
if let Some((_, index, _)) = v
if let Some((_, index)) = v
.iter()
.enumerate()
.map(|(idx, key)| (key.ingredient_index.debug_name(db), idx, key))
.map(|(idx, key)| (key.ingredient_index.debug_name(db), idx))
.min()
{
v.rotate_left(index);