Correct docs that misstate what the code does

This commit is contained in:
Dennis Kobert
2026-09-06 15:58:01 +00:00
parent 305c36fb25
commit e92faf763d
8 changed files with 13 additions and 15 deletions

View File

@@ -418,7 +418,7 @@ impl BorrowTree {
self.nodes.insert(id, (node, path));
}
/// Calls the `Node::serialize` for that specific node, returning for example the captured io record for a monitor node. The node path must match the document node path.
/// Calls the `Node::serialize` for that specific node, returning for example the captured context snapshot for a monitor node. The node path must match the document node path.
pub fn introspect(&self, node_path: &[NodeId]) -> Result<Arc<dyn std::any::Any + Send + Sync + 'static>, IntrospectError> {
let (id, _) = self.source_map.get(node_path).ok_or_else(|| IntrospectError::PathNotFound(node_path.to_vec()))?;
let (node, _path) = self.nodes.get(id).ok_or(IntrospectError::ProtoNodeNotFound(*id))?;

View File

@@ -38,7 +38,6 @@ impl<'r> Rec<'r> {
/// An opaque record value: every non-empty record spills to a claimed frame
/// and the value carries its pointer, while an empty record carries nothing.
/// Only [`Layout::rec`] reads it, against the wiring-proven layout.
#[derive(Clone, Copy)]
pub struct RecordValue<'e> {
pub(in crate::record) ptr: *const u8,

View File

@@ -370,7 +370,7 @@ mod tests {
let bounds = (base as usize, buffer.len() * 8);
let length = "shared across lanes".len();
unsafe { write_element_sized(base, String::from("shared across lanes"), &transient, length) }.unwrap();
// A carried field byte-copies the reference, so both lanes name the one park.
// A carried element byte-copies its park reference, so both lanes name the one park.
let shared = unsafe { base.cast::<*const u8>().read() };
unsafe { base.add(stride).cast::<*const u8>().write(shared) };

View File

@@ -314,8 +314,8 @@ impl<'e> GroupItem<'e> {
}
/// Re-parks an owned item's lanes into `arena`, restoring the resident
/// form; `None` reports arena exhaustion. A resident item returns a plain
/// clone.
/// form; `None` reports arena exhaustion. A resident item re-adopts into
/// `arena`, sharing only where its lanes already live there.
pub fn replay<'a>(&self, arena: &'a crate::arena::Arena) -> Option<GroupItem<'a>> {
let ItemStorage::Owned(owned) = &self.storage else {
// A resident item re-serves at the target arena's own lifetime,
@@ -584,7 +584,7 @@ impl graphene_hash::CacheHash for GroupItem<'_> {
let stride = self.layout.lane_stride();
let frames = self.frames();
for lane in 0..self.len {
// SAFETY: `adopt` filled `len` lanes of `layout`.
// SAFETY: the constructors store `len` lanes of `layout` at the layout's stride.
unsafe { record_content_hash(&self.layout, frames.add(lane * stride), state) };
}
}

View File

@@ -20,7 +20,7 @@ pub struct NodeMetadata {
pub context_features: Vec<ContextFeature>,
pub memoize: bool,
pub inject_scope: bool,
/// The macro appended its hidden `_runtime` and `_source` fields as the last two entries of `fields`.
/// Set where `_runtime` and `_source` are the last two entries of `fields`.
pub async_source_fields: bool,
}
@@ -389,8 +389,8 @@ mod tests {
assert_eq!(held.len(), 4);
}
/// Evaluates its content at three promoted index levels and serves the
/// collected elements.
/// Evaluates its content at three indices of one promoted level and serves
/// the collected elements.
struct RepeatNode<Node0, T> {
content: Node0,
inner: Layout,

View File

@@ -91,7 +91,7 @@ pub fn group_to_legacy_graphic(group: &core_types::record::Group) -> Graphic<'st
}
/// The group as a legacy `List<Graphic>`: a `Graphic` run becomes the items,
/// another typed run becomes one item holding its typed list.
/// another typed run becomes one de-tabled leaf item per lane.
pub fn group_to_legacy_list(group: &core_types::record::Group) -> List<Graphic<'static>> {
let item = &group.content;
if let Some(mut list) = run_to_legacy_list::<Graphic>(item) {

View File

@@ -728,7 +728,7 @@ pub(crate) struct NodePlan {
/// The field and generic derivation shared by the struct/metadata side and the
/// impl side, computed once in [`generate_node_code`] and passed to
/// [`generate_node_impl`]. `regular_fields` is the carrier-skipped slice both
/// [`generate_node_impl`]. `regular_fields` is the non-data field slice both
/// sides agree on.
pub(crate) struct NodeFields<'a> {
pub(crate) data_fields: Vec<&'a ParsedField>,
@@ -1531,8 +1531,7 @@ pub(crate) fn generate_node_impl(crate_ident: &CrateIdent, parsed: &ParsedNodeFn
});
// The extent override is the leveled `extent_at`; consumers query the
// composite `extent(ctx, Level)`, which the trait derives from it. A node
// without `extent = fn` keeps the scalar default (one item at every level).
// composite `extent(ctx, Level)`, which the trait derives from it.
// The typed extent surface: the node's inputs in declaration order (values
// readable without unsafe, inputs as per-level extent queries, derived
// content promoted per copy), then the level paired with the node's depth.

View File

@@ -120,7 +120,7 @@ pub(crate) fn routing_value_indices(regular_fields: &[&ParsedField], generic: &I
}
/// The lazy inputs declaring attribute reads, with their indices into the
/// unit-skipped regular fields.
/// regular fields.
pub(crate) fn lazy_read_fields<'a>(regular_fields: &[&'a ParsedField]) -> Vec<(usize, &'a ParsedField)> {
regular_fields
.iter()
@@ -130,7 +130,7 @@ pub(crate) fn lazy_read_fields<'a>(regular_fields: &[&'a ParsedField]) -> Vec<(u
.collect()
}
/// The indices (into the unit-skipped regular fields) of value inputs whose
/// The indices (into the regular fields) of value inputs whose
/// reads resolve against their own input rather than the carrier's.
pub(crate) fn reading_secondary_indices(regular_fields: &[&ParsedField], skips_carrier: bool) -> Vec<usize> {
regular_fields