diff --git a/node-graph/libraries/core-types/src/attribute.rs b/node-graph/libraries/core-types/src/attribute.rs index 7738b1b03d..938b3189c3 100644 --- a/node-graph/libraries/core-types/src/attribute.rs +++ b/node-graph/libraries/core-types/src/attribute.rs @@ -28,7 +28,11 @@ pub trait Attribute: 'static { /// is the evaluation the value flows in; non-reference values ignore it. /// The value outlives that evaluation, so its `'static` instantiation is /// the one the census registers and layouts stamp their type id from. - type Value<'e>: Copy + Default + std::fmt::Debug + 'e; + /// + /// `Send + Sync` because a record's bytes are these values: `RecordValue` + /// is `Send + Sync` over whatever the field writes put there, and the write + /// path never consults the census, so the bound has to sit here. + type Value<'e>: Copy + Default + std::fmt::Debug + Send + Sync + 'e; /// The name-specific default, filled where an item lacks the attribute. /// Producing a value for any `'e` from no inputs, reference defaults can /// only point at `'static` data, which is what lets the census fill them diff --git a/node-graph/libraries/core-types/src/record/access.rs b/node-graph/libraries/core-types/src/record/access.rs index 7da95ace94..c03f8565d1 100644 --- a/node-graph/libraries/core-types/src/record/access.rs +++ b/node-graph/libraries/core-types/src/record/access.rs @@ -50,9 +50,10 @@ impl std::fmt::Debug for RecordValue<'_> { } } -// SAFETY: `element_write` requires the element `Send + Sync` and attribute payloads -// are `Copy` or arena-backed, so the record bytes behind the pointer are thread-safe; -// `'e` ties the pointer's validity to the shared arena and record-stack discipline. +// SAFETY: `element_write` requires the element `Send + Sync` and every field holds an +// `Attribute::Value`, which the trait bounds `Send + Sync`, so the record bytes behind +// the pointer are thread-safe; `'e` ties the pointer's validity to the shared arena and +// record-stack discipline. unsafe impl Send for RecordValue<'_> {} // SAFETY: as `Send`. unsafe impl Sync for RecordValue<'_> {}