You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/05/21 08:44:37 UTC
(datafusion-sqlparser-rs) branch main updated: Make `visitor` feature `no_std`-compatible (#2343)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
The following commit(s) were added to refs/heads/main by this push:
new e999d3dd Make `visitor` feature `no_std`-compatible (#2343)
e999d3dd is described below
commit e999d3ddcf61bebe7b7aca825a3551b27cee27ac
Author: Luca Cappelletti <ca...@gmail.com>
AuthorDate: Thu May 21 10:39:52 2026 +0200
Make `visitor` feature `no_std`-compatible (#2343)
---
.github/workflows/rust.yml | 1 +
derive/src/visit.rs | 4 ++--
src/ast/visitor.rs | 5 ++++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 2e1da694..628444a8 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -82,6 +82,7 @@ jobs:
with:
targets: 'thumbv6m-none-eabi'
- run: cargo check --no-default-features --target thumbv6m-none-eabi
+ - run: cargo check --no-default-features --features visitor --target thumbv6m-none-eabi
test:
strategy:
diff --git a/derive/src/visit.rs b/derive/src/visit.rs
index baf3eb58..cb02733b 100644
--- a/derive/src/visit.rs
+++ b/derive/src/visit.rs
@@ -62,11 +62,11 @@ pub(crate) fn derive_visit(
fn visit<V: sqlparser::ast::#visitor_trait>(
&#modifier self,
visitor: &mut V
- ) -> ::std::ops::ControlFlow<V::Break> {
+ ) -> ::core::ops::ControlFlow<V::Break> {
#pre_visit
#children
#post_visit
- ::std::ops::ControlFlow::Continue(())
+ ::core::ops::ControlFlow::Continue(())
}
}
};
diff --git a/src/ast/visitor.rs b/src/ast/visitor.rs
index 30673dfa..b14ca544 100644
--- a/src/ast/visitor.rs
+++ b/src/ast/visitor.rs
@@ -17,9 +17,12 @@
//! Recursive visitors for ast Nodes. See [`Visitor`] for more details.
-use crate::ast::{Expr, ObjectName, Query, Select, Statement, TableFactor, ValueWithSpan};
+#[cfg(not(feature = "std"))]
+use alloc::{boxed::Box, string::String, vec::Vec};
use core::ops::ControlFlow;
+use crate::ast::{Expr, ObjectName, Query, Select, Statement, TableFactor, ValueWithSpan};
+
/// A type that can be visited by a [`Visitor`]. See [`Visitor`] for
/// recursively visiting parsed SQL statements.
///
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org