databendlabs/databend · error

unsupported field type for derive(Walk)/derive(WalkMut)

Error message

unsupported field type for derive(Walk)/derive(WalkMut)

What it means

A compile-time guard in emit_walk_for_type: the last path segment of a field's type names a type that has no registered Walk/WalkMut implementation and is not a known primitive or supported container. The derive macro emits this error so unsupported field types fail at compile time instead of generating non-compiling code.

Solutions

  1. Ensure the memory pool's close/shutdown only happens after all spill writers have stopped requesting buffers.
  2. In alloc_buffer, treat the closed-channel error distinctly and surface a shutdown-aware error so callers stop retrying allocation.
  3. Coordinate task cancellation so buffers are released back to the pool before it is closed.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/query/ast/visit_derive/src/lib.rs:224 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11). Data as JSON: /api/errors/bcda2f1901024e35. Report an issue: GitHub.

Appendix: source

Thrown at src/query/ast/visit_derive/src/lib.rs:224

            } else {
                quote!(crate::visit::Walk)
            };
            let method = if mutable {
                quote!(walk_mut)
            } else {
                quote!(walk)
            };
            Ok(quote! {
                match #trait_name::#method(#access, visitor)? {
                    crate::visit::VisitControl::Continue => {}
                    crate::visit::VisitControl::SkipChildren => {}
                    crate::visit::VisitControl::Break(value) => {
                        return Ok(crate::visit::VisitControl::Break(value));
                    }
                }
            })
        }
        _ => Err(Error::new(
            ty.span(),
            "unsupported field type for derive(Walk)/derive(WalkMut)",
        )),
    }
}

fn is_primitive_noop_leaf(name: &str) -> bool {
    // Keep this list intentionally small and in sync with the explicit
    // `impl_noop_walk!` block in `src/query/ast/src/visit.rs`.
    matches!(
        name,
        "bool"
            | "u8"
            | "u16"
            | "u32"
            | "u64"
            | "usize"
            | "i8"

View on GitHub (pinned to 288d84d76e)