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: 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. ///