Remove broken derive_where(Arbitrary) in IR

This commit is contained in:
2026-04-30 20:08:50 -06:00
parent b28a5f7e4f
commit e5c203ce24

View File

@@ -18,6 +18,8 @@
//! A modular definition for desugared Kerolox IR. //! A modular definition for desugared Kerolox IR.
// TODO: implement `Arbitrary` by hand since derive_where doesn't support it
#![warn(missing_docs)] #![warn(missing_docs)]
use std::{ use std::{
@@ -47,7 +49,6 @@ use serde::{Deserialize, Serialize};
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub struct Program<T: ProgramInfo> { pub struct Program<T: ProgramInfo> {
pub relations: BTreeMap<T::RelationLabel, Relation<T>>, pub relations: BTreeMap<T::RelationLabel, Relation<T>>,
@@ -62,7 +63,6 @@ pub struct Program<T: ProgramInfo> {
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub struct Relation<T: ProgramInfo> { pub struct Relation<T: ProgramInfo> {
/// The relation's type. /// The relation's type.
@@ -89,7 +89,6 @@ pub struct Relation<T: ProgramInfo> {
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub struct Rule<T: ProgramInfo> { pub struct Rule<T: ProgramInfo> {
/// The metadata for this rule. /// The metadata for this rule.
@@ -105,7 +104,6 @@ pub struct Rule<T: ProgramInfo> {
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub struct Assumption<T: ProgramInfo> { pub struct Assumption<T: ProgramInfo> {
/// Metadata for this assumption. /// Metadata for this assumption.
@@ -121,7 +119,6 @@ pub struct Assumption<T: ProgramInfo> {
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub struct RuleBody<T: ProgramInfo> { pub struct RuleBody<T: ProgramInfo> {
/// Metadata for this rule body. /// Metadata for this rule body.
@@ -142,7 +139,6 @@ pub struct RuleBody<T: ProgramInfo> {
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub struct Expr<T: ProgramInfo> { pub struct Expr<T: ProgramInfo> {
pub meta: T::ExprMeta, pub meta: T::ExprMeta,
@@ -152,7 +148,6 @@ pub struct Expr<T: ProgramInfo> {
#[derive_where(Clone, Debug, PartialEq, Eq)] #[derive_where(Clone, Debug, PartialEq, Eq)]
#[derive_where(PartialOrd, Ord; T: OrdProgramInfo)] #[derive_where(PartialOrd, Ord; T: OrdProgramInfo)]
#[derive_where(Hash; T: HashProgramInfo)] #[derive_where(Hash; T: HashProgramInfo)]
#[cfg_attr(feature = "fuzz", derive_where(Arbitrary; T: ArbitraryProgramInfo))]
#[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))] #[cfg_attr(feature = "serde", derive_where(Deserialize, Serialize; T: SerdeProgramInfo))]
pub enum ExprKind<T: ProgramInfo> { pub enum ExprKind<T: ProgramInfo> {
Extra(T::ExprExtra), Extra(T::ExprExtra),