From 5ef5a3f30acc0c34d46fc2981a11d76f5edf761b Mon Sep 17 00:00:00 2001 From: Skgland Date: Fri, 20 Feb 2026 22:37:49 +0100 Subject: [PATCH 1/6] replace custom modular_bitfields fork with update upstream part of #2468 --- Cargo.lock | 45 +++++++++++++++++----------------- Cargo.toml | 2 +- _typos.toml | 4 +++ src/arena.rs | 2 +- src/atom_table.rs | 2 +- src/heap_iter.rs | 6 ++--- src/machine/copier.rs | 6 ++--- src/machine/machine_indices.rs | 6 ++--- src/machine/streams.rs | 8 +++--- src/parser/ast.rs | 6 ++--- src/types.rs | 10 ++++---- 11 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fa61925..a12cc878 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1792,6 +1792,27 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "modular-bitfield" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2956e537fc68236d2aa048f55704f231cc93f1c4de42fe1ecb5bd7938061fc4a" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b43b4fd69e3437618106f7754f34021b831a514f9e1a98ae863cabcd8d8dad" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "multer" version = "2.1.0" @@ -2686,27 +2707,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "scryer-modular-bitfield" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f26c70c56d2c94a02545d86384b91994532c2be928c974784b603c2b1f76ac" -dependencies = [ - "scryer-modular-bitfield-impl", - "static_assertions", -] - -[[package]] -name = "scryer-modular-bitfield-impl" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212164841808ccfccf1b0471d91f8cfe675eeb60dbb96e4ca7a1f37b22570a29" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scryer-prolog" version = "0.10.0" @@ -2744,6 +2744,7 @@ dependencies = [ "libffi", "libloading", "maplit", + "modular-bitfield", "native-tls", "num-order", "ordered-float", @@ -2762,7 +2763,6 @@ dependencies = [ "rustyline", "ryu", "scraper", - "scryer-modular-bitfield", "serde", "serde-wasm-bindgen", "serde_json", @@ -3177,7 +3177,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote", "unicode-ident", ] diff --git a/Cargo.toml b/Cargo.toml index 5971a229..a4c6c645 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ lazy_static = "1.5.0" lexical = "7.0.4" libc = "0.2.155" libloading = "0.8" -scryer-modular-bitfield = "0.11.4" +modular-bitfield = "0.13.1" num-order = { version = "1.2.0" } ordered-float = "5.0.0" phf = { version = "0.11", features = ["macros"] } diff --git a/_typos.toml b/_typos.toml index dc829cd3..1e72f376 100644 --- a/_typos.toml +++ b/_typos.toml @@ -16,6 +16,10 @@ extend-ignore-re = [ interm = "interm" IntermReg = "IntermReg" +[type.rust] +extend-glob = [ "*.rs" ] +[type.rust.extend-identifiers] +consts = "consts" # std::{f32,f64}::consts [type.prolog] diff --git a/src/arena.rs b/src/arena.rs index ab108e02..fa6faaa0 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -52,7 +52,7 @@ where payload_offset - header_offset } -#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq)] +#[derive(Specifier, Copy, Clone, Debug, PartialEq)] #[bits = 7] pub enum ArenaHeaderTag { Integer = 0b10, diff --git a/src/atom_table.rs b/src/atom_table.rs index 7a0a818e..aac2d8b5 100644 --- a/src/atom_table.rs +++ b/src/atom_table.rs @@ -23,7 +23,7 @@ use arcu::rcu_ref::RcuRef; use arcu::Rcu; use indexmap::IndexSet; -use scryer_modular_bitfield::prelude::*; +use modular_bitfield::prelude::*; #[bitfield] #[repr(u64)] diff --git a/src/heap_iter.rs b/src/heap_iter.rs index 903fcbc2..fed59451 100644 --- a/src/heap_iter.rs +++ b/src/heap_iter.rs @@ -17,7 +17,7 @@ use crate::types::*; use core::marker::PhantomData; use fxhash::FxBuildHasher; use indexmap::IndexSet; -use scryer_modular_bitfield::prelude::*; +use modular_bitfield::prelude::*; use std::cmp::Ordering; use std::ops::Deref; @@ -496,7 +496,7 @@ impl<'a> Iterator for EagerStackfulPreOrderHeapIter<'a> { } } -#[derive(BitfieldSpecifier, Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Specifier, Clone, Copy, Debug, PartialEq, Eq)] #[bits = 2] enum IterStackLocTag { Iterable, @@ -504,7 +504,7 @@ enum IterStackLocTag { PendingMark, } -#[derive(BitfieldSpecifier, Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Specifier, Clone, Copy, Debug, PartialEq, Eq)] #[bits = 1] pub enum HeapOrStackTag { Heap, diff --git a/src/machine/copier.rs b/src/machine/copier.rs index 4de9a0c1..dc55ba26 100644 --- a/src/machine/copier.rs +++ b/src/machine/copier.rs @@ -9,14 +9,14 @@ use crate::machine::heap::*; use crate::machine::stack::*; use crate::types::*; -use scryer_modular_bitfield::specifiers::*; -use scryer_modular_bitfield::*; +use modular_bitfield::specifiers::*; +use modular_bitfield::*; use std::collections::BTreeMap; use std::mem; use std::ops::{IndexMut, Range}; -#[derive(BitfieldSpecifier, Copy, Clone, Debug)] +#[derive(Specifier, Copy, Clone, Debug)] #[bits = 6] enum TrailRefTag { HeapCell = 0b001011, diff --git a/src/machine/machine_indices.rs b/src/machine/machine_indices.rs index a2cb5050..1036ec2a 100644 --- a/src/machine/machine_indices.rs +++ b/src/machine/machine_indices.rs @@ -14,8 +14,8 @@ use crate::offset_table::*; use fxhash::FxBuildHasher; use indexmap::{IndexMap, IndexSet}; -use scryer_modular_bitfield::specifiers::*; -use scryer_modular_bitfield::{bitfield, BitfieldSpecifier}; +use modular_bitfield::specifiers::*; +use modular_bitfield::{bitfield, Specifier}; use std::cmp::Ordering; use std::collections::BTreeSet; @@ -66,7 +66,7 @@ impl PartialOrd for HeapCellValue { } } -#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq)] +#[derive(Specifier, Copy, Clone, Debug, PartialEq)] #[bits = 7] pub enum IndexPtrTag { DynamicUndefined = 0b1000101, // a predicate, declared as dynamic, whose location in code is as yet undefined. diff --git a/src/machine/streams.rs b/src/machine/streams.rs index 0d88ca58..2151ba74 100644 --- a/src/machine/streams.rs +++ b/src/machine/streams.rs @@ -14,7 +14,7 @@ use crate::machine::machine_indices::*; use crate::machine::machine_state::*; use crate::types::*; -pub use scryer_modular_bitfield::prelude::*; +pub use modular_bitfield::prelude::*; #[cfg(feature = "http")] use bytes::{buf::Reader as BufReader, Buf, Bytes}; @@ -43,7 +43,7 @@ use warp::hyper; mod compat; pub use compat::*; -#[derive(Debug, BitfieldSpecifier, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Specifier, Clone, Copy, PartialEq, Eq, Hash)] #[bits = 1] pub enum StreamType { Binary, @@ -76,7 +76,7 @@ impl StreamType { } } -#[derive(Debug, BitfieldSpecifier, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Specifier, Clone, Copy, PartialEq, Eq, Hash)] #[bits = 2] pub enum EOFAction { EOFCode, @@ -84,7 +84,7 @@ pub enum EOFAction { Reset, } -#[derive(Debug, BitfieldSpecifier, Copy, Clone, PartialEq)] +#[derive(Debug, Specifier, Copy, Clone, PartialEq)] #[bits = 2] pub(crate) enum AtEndOfStream { Not, diff --git a/src/parser/ast.rs b/src/parser/ast.rs index ba18d36e..823d3270 100644 --- a/src/parser/ast.rs +++ b/src/parser/ast.rs @@ -24,8 +24,8 @@ use dashu::Rational; use fxhash::FxBuildHasher; use indexmap::IndexMap; use ordered_float::OrderedFloat; -use scryer_modular_bitfield::error::OutOfBounds; -use scryer_modular_bitfield::prelude::*; +use modular_bitfield::error::OutOfBounds; +use modular_bitfield::prelude::*; pub type Specifier = u32; @@ -671,7 +671,7 @@ impl Fixnum { #[inline] pub fn get_tag(&self) -> HeapCellValueTag { - use scryer_modular_bitfield::Specifier; + use modular_bitfield::Specifier; HeapCellValueTag::from_bytes(self.tag()).unwrap() } diff --git a/src/types.rs b/src/types.rs index 7cc843bc..8bb5b211 100644 --- a/src/types.rs +++ b/src/types.rs @@ -19,7 +19,7 @@ use std::ops::{Add, Sub, SubAssign}; use dashu::{Integer, Rational}; -#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[repr(u8)] #[bits = 6] pub enum HeapCellValueTag { @@ -46,7 +46,7 @@ pub enum HeapCellValueTag { TrailedBlackboardOffset = 0b110001, } -#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[repr(u8)] #[bits = 6] pub enum HeapCellValueView { @@ -73,7 +73,7 @@ pub enum HeapCellValueView { TrailedBlackboardOffset = 0b110001, } -#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[bits = 1] pub enum ConsPtrMaskTag { Cons = 0b0, @@ -112,7 +112,7 @@ impl ConsPtr { } } -#[derive(BitfieldSpecifier, Copy, Clone, Debug)] +#[derive(Specifier, Copy, Clone, Debug)] #[bits = 6] pub(crate) enum RefTag { HeapCell = 0b001011, @@ -199,7 +199,7 @@ pub enum TrailRef { } #[allow(clippy::enum_variant_names)] // allow the common "Trailed" prefix -#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[bits = 6] pub(crate) enum TrailEntryTag { TrailedHeapVar = 0b101111, From 7d0d61d789c86003b44a90826335a5b05425a2f7 Mon Sep 17 00:00:00 2001 From: Skgland Date: Fri, 20 Feb 2026 22:45:09 +0100 Subject: [PATCH 2/6] remove no longer necessary allows --- src/arena.rs | 3 --- src/arithmetic.rs | 2 -- src/atom_table.rs | 3 --- src/heap_iter.rs | 3 --- src/machine/copier.rs | 2 -- src/machine/machine_indices.rs | 3 --- src/machine/streams.rs | 2 -- src/parser/ast.rs | 3 --- src/types.rs | 3 --- 9 files changed, 24 deletions(-) diff --git a/src/arena.rs b/src/arena.rs index fa6faaa0..d4e949ba 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -1,6 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - #[cfg(feature = "http")] use crate::http::{HttpListener, HttpResponse}; use crate::machine::heap::AllocError; diff --git a/src/arithmetic.rs b/src/arithmetic.rs index 9a70962f..a0cf61b0 100644 --- a/src/arithmetic.rs +++ b/src/arithmetic.rs @@ -1,5 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work - use crate::allocator::*; use crate::arena::*; use crate::atom_table::*; diff --git a/src/atom_table.rs b/src/atom_table.rs index aac2d8b5..7f828654 100644 --- a/src/atom_table.rs +++ b/src/atom_table.rs @@ -1,6 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use crate::machine::heap::AllocError; use crate::parser::ast::MAX_ARITY; use crate::raw_block::*; diff --git a/src/heap_iter.rs b/src/heap_iter.rs index fed59451..9c35e710 100644 --- a/src/heap_iter.rs +++ b/src/heap_iter.rs @@ -1,6 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use crate::arena::Arena; use crate::forms::Number; #[cfg(test)] diff --git a/src/machine/copier.rs b/src/machine/copier.rs index dc55ba26..dec0f427 100644 --- a/src/machine/copier.rs +++ b/src/machine/copier.rs @@ -1,5 +1,3 @@ -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use fxhash::FxBuildHasher; use indexmap::IndexSet; diff --git a/src/machine/machine_indices.rs b/src/machine/machine_indices.rs index 1036ec2a..bfb8a2f3 100644 --- a/src/machine/machine_indices.rs +++ b/src/machine/machine_indices.rs @@ -1,6 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use crate::parser::ast::*; use crate::atom_table::*; diff --git a/src/machine/streams.rs b/src/machine/streams.rs index 2151ba74..57617400 100644 --- a/src/machine/streams.rs +++ b/src/machine/streams.rs @@ -1,5 +1,3 @@ -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use crate::arena::*; use crate::atom_table::*; use crate::functor_macro::*; diff --git a/src/parser/ast.rs b/src/parser/ast.rs index 823d3270..5ea1f116 100644 --- a/src/parser/ast.rs +++ b/src/parser/ast.rs @@ -1,6 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use crate::arena::*; use crate::atom_table::*; use crate::offset_table::*; diff --git a/src/types.rs b/src/types.rs index 8bb5b211..cdb86d42 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,6 +1,3 @@ -#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work -#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126 - use crate::arena::*; use crate::atom_table::*; use crate::forms::*; From 49e49b425dcc56438fdf1e4e6d42823bc629ab7f Mon Sep 17 00:00:00 2001 From: Skgland Date: Fri, 20 Feb 2026 22:47:08 +0100 Subject: [PATCH 3/6] fix clippy lint warning --- src/debray_allocator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debray_allocator.rs b/src/debray_allocator.rs index 30fae204..6988420f 100644 --- a/src/debray_allocator.rs +++ b/src/debray_allocator.rs @@ -106,7 +106,7 @@ impl BranchStack { let branch_num = self .last() .map(|occurrences| occurrences.current_branch_num.clone()) - .unwrap_or_else(|| BranchNumber::default()); + .unwrap_or_default(); BranchDesignator { branch_num } } From 2a79d6fc40dcdbffadc7fe9187deccd372052f57 Mon Sep 17 00:00:00 2001 From: Skgland Date: Fri, 20 Feb 2026 22:52:25 +0100 Subject: [PATCH 4/6] run cargo fmt --- src/parser/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/ast.rs b/src/parser/ast.rs index 5ea1f116..4f128c59 100644 --- a/src/parser/ast.rs +++ b/src/parser/ast.rs @@ -20,9 +20,9 @@ use dashu::Integer; use dashu::Rational; use fxhash::FxBuildHasher; use indexmap::IndexMap; -use ordered_float::OrderedFloat; use modular_bitfield::error::OutOfBounds; use modular_bitfield::prelude::*; +use ordered_float::OrderedFloat; pub type Specifier = u32; From 0ceab41b3909969d49ee4e84036e7b6e26d5f85a Mon Sep 17 00:00:00 2001 From: Skgland Date: Fri, 20 Feb 2026 22:57:44 +0100 Subject: [PATCH 5/6] fix warning in CI about using apt in a script --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8c83118..7ef910e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,7 +180,7 @@ jobs: version=`yq -ptoml -oj -r '.package[] | select(.name == "iai-callgrind") | .version' Cargo.lock` echo installing iai-callgrind "$version" cargo install iai-callgrind-runner --force --version "$version" - sudo apt install valgrind -y + sudo apt-get install valgrind -y - name: Test and report run: | From 2dc904aa73766d068ad79d086676642399f69a24 Mon Sep 17 00:00:00 2001 From: Skgland Date: Fri, 20 Feb 2026 23:00:45 +0100 Subject: [PATCH 6/6] run apt update before apt install https://github.com/orgs/community/discussions/145882#discussioncomment-11447924 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ef910e2..34a90ef5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,6 +180,7 @@ jobs: version=`yq -ptoml -oj -r '.package[] | select(.name == "iai-callgrind") | .version' Cargo.lock` echo installing iai-callgrind "$version" cargo install iai-callgrind-runner --force --version "$version" + sudo apt-get update -y sudo apt-get install valgrind -y - name: Test and report