chore(tvix/eval): explicitly set #[repr(transparent)] on wrappers

For representation wrappers that are used to control the visibility of
type internals, this ensures that the wrapper does not increase the
size of the type.

In practice, the optimiser likely does this anyways but it is good to
guarantee it.

Change-Id: Ic6df7d668fe6006dfbd5b6cfcfc2088afa95b810
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6178
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-12 17:21:24 +03:00 committed by tazjin
parent 4523703a98
commit 4c9d3fa2a6
3 changed files with 3 additions and 0 deletions

View file

@ -67,6 +67,7 @@ impl AttrsRep {
}
}
#[repr(transparent)]
#[derive(Clone, Debug)]
pub struct NixAttrs(AttrsRep);

View file

@ -3,6 +3,7 @@ use std::fmt::Display;
use super::Value;
#[repr(transparent)]
#[derive(Clone, Debug, PartialEq)]
pub struct NixList(Vec<Value>);

View file

@ -11,6 +11,7 @@ enum StringRepr {
Heap(String),
}
#[repr(transparent)]
#[derive(Clone, Debug)]
pub struct NixString(StringRepr);