Merge pull request #3252 from Skgland/towards-a-crate-without-syn@1

replace custom modular_bitfields fork with update upstream
This commit is contained in:
Mark Thom
2026-03-09 22:08:28 -07:00
committed by GitHub
13 changed files with 52 additions and 72 deletions

View File

@@ -180,7 +180,8 @@ jobs:
version=`yq -ptoml -oj -r '.package[] | select(.name == "iai-callgrind") | .version' Cargo.lock` version=`yq -ptoml -oj -r '.package[] | select(.name == "iai-callgrind") | .version' Cargo.lock`
echo installing iai-callgrind "$version" echo installing iai-callgrind "$version"
cargo install iai-callgrind-runner --force --version "$version" cargo install iai-callgrind-runner --force --version "$version"
sudo apt install valgrind -y sudo apt-get update -y
sudo apt-get install valgrind -y
- name: Test and report - name: Test and report
run: | run: |

45
Cargo.lock generated
View File

@@ -1792,6 +1792,27 @@ dependencies = [
"windows-sys 0.52.0", "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]] [[package]]
name = "multer" name = "multer"
version = "2.1.0" version = "2.1.0"
@@ -2686,27 +2707,6 @@ dependencies = [
"tendril", "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]] [[package]]
name = "scryer-prolog" name = "scryer-prolog"
version = "0.10.0" version = "0.10.0"
@@ -2744,6 +2744,7 @@ dependencies = [
"libffi", "libffi",
"libloading", "libloading",
"maplit", "maplit",
"modular-bitfield",
"native-tls", "native-tls",
"num-order", "num-order",
"ordered-float", "ordered-float",
@@ -2762,7 +2763,6 @@ dependencies = [
"rustyline", "rustyline",
"ryu", "ryu",
"scraper", "scraper",
"scryer-modular-bitfield",
"serde", "serde",
"serde-wasm-bindgen", "serde-wasm-bindgen",
"serde_json", "serde_json",
@@ -3177,7 +3177,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote",
"unicode-ident", "unicode-ident",
] ]

View File

@@ -66,7 +66,7 @@ lazy_static = "1.5.0"
lexical = "7.0.4" lexical = "7.0.4"
libc = "0.2.155" libc = "0.2.155"
libloading = "0.8" libloading = "0.8"
scryer-modular-bitfield = "0.11.4" modular-bitfield = "0.13.1"
num-order = { version = "1.2.0" } num-order = { version = "1.2.0" }
ordered-float = "5.0.0" ordered-float = "5.0.0"
phf = { version = "0.11", features = ["macros"] } phf = { version = "0.11", features = ["macros"] }

View File

@@ -16,6 +16,10 @@ extend-ignore-re = [
interm = "interm" interm = "interm"
IntermReg = "IntermReg" IntermReg = "IntermReg"
[type.rust]
extend-glob = [ "*.rs" ]
[type.rust.extend-identifiers]
consts = "consts" # std::{f32,f64}::consts
[type.prolog] [type.prolog]

View File

@@ -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")] #[cfg(feature = "http")]
use crate::http::{HttpListener, HttpResponse}; use crate::http::{HttpListener, HttpResponse};
use crate::machine::heap::AllocError; use crate::machine::heap::AllocError;
@@ -52,7 +49,7 @@ where
payload_offset - header_offset payload_offset - header_offset
} }
#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq)] #[derive(Specifier, Copy, Clone, Debug, PartialEq)]
#[bits = 7] #[bits = 7]
pub enum ArenaHeaderTag { pub enum ArenaHeaderTag {
Integer = 0b10, Integer = 0b10,

View File

@@ -1,5 +1,3 @@
#![allow(clippy::new_without_default)] // annotating structs annotated with #[bitfield] doesn't work
use crate::allocator::*; use crate::allocator::*;
use crate::arena::*; use crate::arena::*;
use crate::atom_table::*; use crate::atom_table::*;

View File

@@ -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::machine::heap::AllocError;
use crate::parser::ast::MAX_ARITY; use crate::parser::ast::MAX_ARITY;
use crate::raw_block::*; use crate::raw_block::*;
@@ -23,7 +20,7 @@ use arcu::rcu_ref::RcuRef;
use arcu::Rcu; use arcu::Rcu;
use indexmap::IndexSet; use indexmap::IndexSet;
use scryer_modular_bitfield::prelude::*; use modular_bitfield::prelude::*;
#[bitfield] #[bitfield]
#[repr(u64)] #[repr(u64)]

View File

@@ -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::arena::Arena;
use crate::forms::Number; use crate::forms::Number;
#[cfg(test)] #[cfg(test)]
@@ -17,7 +14,7 @@ use crate::types::*;
use core::marker::PhantomData; use core::marker::PhantomData;
use fxhash::FxBuildHasher; use fxhash::FxBuildHasher;
use indexmap::IndexSet; use indexmap::IndexSet;
use scryer_modular_bitfield::prelude::*; use modular_bitfield::prelude::*;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::ops::Deref; use std::ops::Deref;
@@ -496,7 +493,7 @@ impl<'a> Iterator for EagerStackfulPreOrderHeapIter<'a> {
} }
} }
#[derive(BitfieldSpecifier, Clone, Copy, Debug, PartialEq, Eq)] #[derive(Specifier, Clone, Copy, Debug, PartialEq, Eq)]
#[bits = 2] #[bits = 2]
enum IterStackLocTag { enum IterStackLocTag {
Iterable, Iterable,
@@ -504,7 +501,7 @@ enum IterStackLocTag {
PendingMark, PendingMark,
} }
#[derive(BitfieldSpecifier, Clone, Copy, Debug, PartialEq, Eq)] #[derive(Specifier, Clone, Copy, Debug, PartialEq, Eq)]
#[bits = 1] #[bits = 1]
pub enum HeapOrStackTag { pub enum HeapOrStackTag {
Heap, Heap,

View File

@@ -1,5 +1,3 @@
#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126
use fxhash::FxBuildHasher; use fxhash::FxBuildHasher;
use indexmap::IndexSet; use indexmap::IndexSet;
@@ -9,14 +7,14 @@ use crate::machine::heap::*;
use crate::machine::stack::*; use crate::machine::stack::*;
use crate::types::*; use crate::types::*;
use scryer_modular_bitfield::specifiers::*; use modular_bitfield::specifiers::*;
use scryer_modular_bitfield::*; use modular_bitfield::*;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::mem; use std::mem;
use std::ops::{IndexMut, Range}; use std::ops::{IndexMut, Range};
#[derive(BitfieldSpecifier, Copy, Clone, Debug)] #[derive(Specifier, Copy, Clone, Debug)]
#[bits = 6] #[bits = 6]
enum TrailRefTag { enum TrailRefTag {
HeapCell = 0b001011, HeapCell = 0b001011,

View File

@@ -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::parser::ast::*;
use crate::atom_table::*; use crate::atom_table::*;
@@ -14,8 +11,8 @@ use crate::offset_table::*;
use fxhash::FxBuildHasher; use fxhash::FxBuildHasher;
use indexmap::{IndexMap, IndexSet}; use indexmap::{IndexMap, IndexSet};
use scryer_modular_bitfield::specifiers::*; use modular_bitfield::specifiers::*;
use scryer_modular_bitfield::{bitfield, BitfieldSpecifier}; use modular_bitfield::{bitfield, Specifier};
use std::cmp::Ordering; use std::cmp::Ordering;
use std::collections::BTreeSet; use std::collections::BTreeSet;
@@ -66,7 +63,7 @@ impl PartialOrd<Ref> for HeapCellValue {
} }
} }
#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq)] #[derive(Specifier, Copy, Clone, Debug, PartialEq)]
#[bits = 7] #[bits = 7]
pub enum IndexPtrTag { pub enum IndexPtrTag {
DynamicUndefined = 0b1000101, // a predicate, declared as dynamic, whose location in code is as yet undefined. DynamicUndefined = 0b1000101, // a predicate, declared as dynamic, whose location in code is as yet undefined.

View File

@@ -1,5 +1,3 @@
#![allow(unused_parens)] // see mthom/scryer-prolog#3092 and rust-lang/rust#147126
use crate::arena::*; use crate::arena::*;
use crate::atom_table::*; use crate::atom_table::*;
use crate::functor_macro::*; use crate::functor_macro::*;
@@ -14,7 +12,7 @@ use crate::machine::machine_indices::*;
use crate::machine::machine_state::*; use crate::machine::machine_state::*;
use crate::types::*; use crate::types::*;
pub use scryer_modular_bitfield::prelude::*; pub use modular_bitfield::prelude::*;
#[cfg(feature = "http")] #[cfg(feature = "http")]
use bytes::{buf::Reader as BufReader, Buf, Bytes}; use bytes::{buf::Reader as BufReader, Buf, Bytes};
@@ -43,7 +41,7 @@ use warp::hyper;
mod compat; mod compat;
pub use compat::*; pub use compat::*;
#[derive(Debug, BitfieldSpecifier, Clone, Copy, PartialEq, Eq, Hash)] #[derive(Debug, Specifier, Clone, Copy, PartialEq, Eq, Hash)]
#[bits = 1] #[bits = 1]
pub enum StreamType { pub enum StreamType {
Binary, Binary,
@@ -76,7 +74,7 @@ impl StreamType {
} }
} }
#[derive(Debug, BitfieldSpecifier, Clone, Copy, PartialEq, Eq, Hash)] #[derive(Debug, Specifier, Clone, Copy, PartialEq, Eq, Hash)]
#[bits = 2] #[bits = 2]
pub enum EOFAction { pub enum EOFAction {
EOFCode, EOFCode,
@@ -84,7 +82,7 @@ pub enum EOFAction {
Reset, Reset,
} }
#[derive(Debug, BitfieldSpecifier, Copy, Clone, PartialEq)] #[derive(Debug, Specifier, Copy, Clone, PartialEq)]
#[bits = 2] #[bits = 2]
pub(crate) enum AtEndOfStream { pub(crate) enum AtEndOfStream {
Not, Not,

View File

@@ -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::arena::*;
use crate::atom_table::*; use crate::atom_table::*;
use crate::offset_table::*; use crate::offset_table::*;
@@ -22,9 +19,9 @@ use dashu::Integer;
use dashu::Rational; use dashu::Rational;
use fxhash::FxBuildHasher; use fxhash::FxBuildHasher;
use indexmap::IndexMap; use indexmap::IndexMap;
use modular_bitfield::error::OutOfBounds;
use modular_bitfield::prelude::*;
use ordered_float::OrderedFloat; use ordered_float::OrderedFloat;
use scryer_modular_bitfield::error::OutOfBounds;
use scryer_modular_bitfield::prelude::*;
pub type Specifier = u32; pub type Specifier = u32;
@@ -677,7 +674,7 @@ impl Fixnum {
#[inline] #[inline]
pub fn get_tag(&self) -> HeapCellValueTag { pub fn get_tag(&self) -> HeapCellValueTag {
use scryer_modular_bitfield::Specifier; use modular_bitfield::Specifier;
HeapCellValueTag::from_bytes(self.tag()).unwrap() HeapCellValueTag::from_bytes(self.tag()).unwrap()
} }

View File

@@ -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::arena::*;
use crate::atom_table::*; use crate::atom_table::*;
use crate::forms::*; use crate::forms::*;
@@ -19,7 +16,7 @@ use std::ops::{Add, Sub, SubAssign};
use dashu::{Integer, Rational}; use dashu::{Integer, Rational};
#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u8)] #[repr(u8)]
#[bits = 6] #[bits = 6]
pub enum HeapCellValueTag { pub enum HeapCellValueTag {
@@ -46,7 +43,7 @@ pub enum HeapCellValueTag {
TrailedBlackboardOffset = 0b110001, TrailedBlackboardOffset = 0b110001,
} }
#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u8)] #[repr(u8)]
#[bits = 6] #[bits = 6]
pub enum HeapCellValueView { pub enum HeapCellValueView {
@@ -73,7 +70,7 @@ pub enum HeapCellValueView {
TrailedBlackboardOffset = 0b110001, TrailedBlackboardOffset = 0b110001,
} }
#[derive(BitfieldSpecifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[derive(Specifier, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[bits = 1] #[bits = 1]
pub enum ConsPtrMaskTag { pub enum ConsPtrMaskTag {
Cons = 0b0, Cons = 0b0,
@@ -112,7 +109,7 @@ impl ConsPtr {
} }
} }
#[derive(BitfieldSpecifier, Copy, Clone, Debug)] #[derive(Specifier, Copy, Clone, Debug)]
#[bits = 6] #[bits = 6]
pub(crate) enum RefTag { pub(crate) enum RefTag {
HeapCell = 0b001011, HeapCell = 0b001011,
@@ -199,7 +196,7 @@ pub enum TrailRef {
} }
#[allow(clippy::enum_variant_names)] // allow the common "Trailed" prefix #[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] #[bits = 6]
pub(crate) enum TrailEntryTag { pub(crate) enum TrailEntryTag {
TrailedHeapVar = 0b101111, TrailedHeapVar = 0b101111,