From f1940c1d41deb4fc74439f4dba69e30bf703d0ad Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Wed, 20 May 2026 15:30:28 +0200 Subject: [PATCH 1/2] Make `visitor` feature no_std-compatible --- derive/src/visit.rs | 4 ++-- src/ast/visitor.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/derive/src/visit.rs b/derive/src/visit.rs index baf3eb583b..cb02733b77 100644 --- a/derive/src/visit.rs +++ b/derive/src/visit.rs @@ -62,11 +62,11 @@ pub(crate) fn derive_visit( fn visit( &#modifier self, visitor: &mut V - ) -> ::std::ops::ControlFlow { + ) -> ::core::ops::ControlFlow { #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 30673dfa03..b14ca544a8 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. /// From b14285d1d03e8f859f403b5430843c933531be9e Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Wed, 20 May 2026 15:30:33 +0200 Subject: [PATCH 2/2] CI: check `visitor` feature under no_std --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2e1da6941f..628444a86a 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: