This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch 
gh-readonly-queue/main/pr-2068-c8531d41a1985951538dae3a78d73ea69436d4f2
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git

commit 218f43cf2de1b436637430bbd936613b30e277a9
Author: niebayes <[email protected]>
AuthorDate: Thu Oct 16 16:37:01 2025 +0800

    chore: add stack overflow warning for Visitor and VisitorMut (#2068)
---
 src/ast/visitor.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/ast/visitor.rs b/src/ast/visitor.rs
index 7840f0e1..328f925f 100644
--- a/src/ast/visitor.rs
+++ b/src/ast/visitor.rs
@@ -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
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to