feat: rec attrset

This commit is contained in:
2025-08-08 12:12:23 +08:00
parent 67cdcfea33
commit a9cfddbf5c
13 changed files with 147 additions and 180 deletions

View File

@@ -20,20 +20,10 @@ use nixjit_value::Const as PubConst;
///
/// Using a newtype wrapper like this prevents accidentally mixing up different kinds of indices.
#[repr(transparent)]
#[derive(Debug, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ExprId(usize);
impl ExprId {
/// Creates a clone of the `ExprId`.
///
/// # Safety
/// This is a shallow copy of the index. The caller must ensure that the lifetime
/// and validity of the expression being referenced are handled correctly.
#[inline(always)]
pub unsafe fn clone(&self) -> Self {
Self(self.0)
}
/// Returns the raw `usize` index.
///
/// # Safety