Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ast/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ visit_noop!(bigdecimal::BigDecimal);
/// ```
pub trait Visitor {
/// Type returned when the recursion returns early.
///
/// Important note: The `Break` type should be kept as small as possible to prevent
/// stack overflow during recursion. If you need to return an error, consider
/// boxing it with `Box` to minimize stack usage.
type Break;

/// Invoked for any queries that appear in the AST before visiting children
Expand Down Expand Up @@ -290,6 +294,10 @@ pub trait Visitor {
/// ```
pub trait VisitorMut {
/// Type returned when the recursion returns early.
///
/// Important note: The `Break` type should be kept as small as possible to prevent
/// stack overflow during recursion. If you need to return an error, consider
/// boxing it with `Box` to minimize stack usage.
type Break;

/// Invoked for any queries that appear in the AST before visiting children
Expand Down