mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
chore: add stack overflow warning for Visitor and VisitorMut (#2068)
This commit is contained in:
parent
c8531d41a1
commit
218f43cf2d
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue