From 609844a0db96c68a48e63b79cea413a7fc6eee8b Mon Sep 17 00:00:00 2001 From: discord9 <55937128+discord9@users.noreply.github.com> Date: Wed, 21 Oct 2026 16:31:30 +0800 Subject: [PATCH] docs(promql): link the validator by the node that has it `NativeTree` has no `validate`; the method lives on `NativeNode`. Five doc comments linked the tree, so rustdoc reports an unresolved link for each and the published API docs lose the reference. Retarget every one at `NativeNode::validate`; no wording changes. Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> --- src/query/src/promql/native_compile.rs | 8 ++++---- src/query/src/promql/native_compile/tests.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/query/src/promql/native_compile.rs b/src/query/src/promql/native_compile.rs index 498d3e70974..4ba28471536 100644 --- a/src/query/src/promql/native_compile.rs +++ b/src/query/src/promql/native_compile.rs @@ -124,7 +124,7 @@ const SUPPORTED: &str = "a selector, a range function over a range selector — /// its last chunk before the next, so chunks of different series may not interleave, and an /// `Interleaved` declaration is refused here for every shape this compiler accepts. That is where /// the refusal belongs: no accepted shape can consume interleaved chunks, so a tree declaring one -/// cannot be built here at all. [`NativeTree::validate`]'s window branch checks the same thing, so +/// cannot be built here at all. [`NativeNode::validate`]'s window branch checks the same thing, so /// if both land this refusal comes first and the tree check is a backstop for a tree built some /// other way. /// @@ -214,7 +214,7 @@ fn compile_expr(context: &Context, expr: &PromExpr) -> Result { /// /// The grid is the statement's rather than the constant's own: a constant has no timestamps, so the /// only positions it can be broadcast over are the ones the statement is evaluated at, and -/// [`NativeTree::validate`] compares a binary operation's two grids by spec rather than by +/// [`NativeNode::validate`] compares a binary operation's two grids by spec rather than by /// allocation. fn scalar_node(context: &Context, value: f64) -> Result { Ok(NativeNode { @@ -332,7 +332,7 @@ fn broadcast(left: NativeNode, right: NativeNode, op: BinaryOp, return_bool: boo /// The matching a vector-and-constant operation records. /// -/// Nothing is matched: a scalar carries no labels, so [`NativeTree::validate`] broadcasts it and +/// Nothing is matched: a scalar carries no labels, so [`NativeNode::validate`] broadcasts it and /// reads neither `labels` nor `cardinality`. They carry the default a vector–vector operation of the /// same operator would have, which is also the only matching PromQL allows here — it rejects /// `on`, `ignoring`, `group_left` and `group_right` on a scalar–vector operation. `return_bool` is @@ -494,7 +494,7 @@ fn window_call( /// /// The output is the input's own type: a pointwise function moves no value to another grid point /// and reports one value per field it was given, so the map's schema is the input's allocation -/// rather than a copy that merely agrees with it. [`NativeTree::validate`] does not require that +/// rather than a copy that merely agrees with it. [`NativeNode::validate`] does not require that /// sharing: it compares the map's grid with its input's by [`EvalGrid::spec`] and its field count /// with its input's, so a map that allocated an equal grid of its own would validate the same way. /// The only comparison by identity is an input node's, whose output has to be the very binding it diff --git a/src/query/src/promql/native_compile/tests.rs b/src/query/src/promql/native_compile/tests.rs index d5cf3e21887..9f3f6661876 100644 --- a/src/query/src/promql/native_compile/tests.rs +++ b/src/query/src/promql/native_compile/tests.rs @@ -1022,7 +1022,7 @@ fn a_math_function_maps_over_the_node_its_argument_compiles_to() { /// /// The maps are separate nodes because the arguments nest, not because the compiler knows /// `clamp_min(abs(...))`: a compiler that bound the pair to one node would fail the tree assertions -/// here. The grids are compared by their spec, which is what [`NativeTree::validate`] compares: a +/// here. The grids are compared by their spec, which is what [`NativeNode::validate`] compares: a /// map that allocated a second, equal grid would still be the window's layout, while one that /// reported a different grid or different fields would not. #[test]