Fix feature builds.

This commit is contained in:
Stephen Chung 2021-01-06 18:22:45 +08:00
parent a5d6392107
commit e059ca009c
5 changed files with 10 additions and 14 deletions

View File

@ -9,16 +9,13 @@ pub struct Point {
#[export_module] #[export_module]
pub mod test_module { pub mod test_module {
pub use super::Point; pub use super::Point;
pub fn test_fn(input: Pointer) -> bool { pub fn test_fn(input: Point) -> bool {
input.x < input.y input.x < input.y
} }
} }
fn main() { fn main() {
let n = Point { let n = Point { x: 0.0, y: 10.0 };
x: 0.0,
y: 10.0,
};
if test_module::test_fn(n) { if test_module::test_fn(n) {
println!("yes"); println!("yes");
} else { } else {

View File

@ -1,13 +1,12 @@
//! Configuration settings for [`Engine`]. //! Configuration settings for [`Engine`].
use crate::stdlib::{ use crate::stdlib::{format, num::NonZeroU8, string::String};
format,
num::{NonZeroU64, NonZeroU8, NonZeroUsize},
string::String,
};
use crate::token::Token; use crate::token::Token;
use crate::Engine; use crate::Engine;
#[cfg(not(feature = "unchecked"))]
use crate::stdlib::num::{NonZeroU64, NonZeroUsize};
#[cfg(not(feature = "no_module"))] #[cfg(not(feature = "no_module"))]
use crate::stdlib::boxed::Box; use crate::stdlib::boxed::Box;

View File

@ -136,7 +136,7 @@ pub use utils::ImmutableString;
use fn_native::Locked; use fn_native::Locked;
#[cfg(feature = "internals")] #[cfg(feature = "internals")]
pub use utils::{calc_native_fn_hash, calc_script_fn_hash}; pub use utils::{calc_native_fn_hash, calc_script_fn_hash, HashableHashMap};
#[cfg(not(feature = "internals"))] #[cfg(not(feature = "internals"))]
pub(crate) use utils::{calc_native_fn_hash, calc_script_fn_hash}; pub(crate) use utils::{calc_native_fn_hash, calc_script_fn_hash};
@ -184,8 +184,7 @@ pub use token::{get_next_token, parse_string_literal, InputStream, Token, Tokeni
#[cfg(feature = "internals")] #[cfg(feature = "internals")]
#[deprecated = "this type is volatile and may change"] #[deprecated = "this type is volatile and may change"]
pub use ast::{ pub use ast::{
BinaryExpr, CustomExpr, Expr, FloatWrapper, FnCallExpr, HashableHashMap, Ident, ReturnType, BinaryExpr, CustomExpr, Expr, FloatWrapper, FnCallExpr, Ident, ReturnType, ScriptFnDef, Stmt,
ScriptFnDef, Stmt,
}; };
#[cfg(feature = "internals")] #[cfg(feature = "internals")]

View File

@ -1806,7 +1806,7 @@ impl Engine {
#[cfg(not(feature = "unchecked"))] #[cfg(not(feature = "unchecked"))]
max_string_size: self.limits.max_string_size, max_string_size: self.limits.max_string_size,
#[cfg(feature = "unchecked")] #[cfg(feature = "unchecked")]
max_string_size: 0, max_string_size: None,
non_unary: false, non_unary: false,
comment_level: 0, comment_level: 0,
end_with_none: false, end_with_none: false,

View File

@ -15,6 +15,7 @@ use crate::stdlib::{
ops::{Add, AddAssign, Deref, DerefMut}, ops::{Add, AddAssign, Deref, DerefMut},
str::FromStr, str::FromStr,
string::{String, ToString}, string::{String, ToString},
vec::Vec,
}; };
use crate::Shared; use crate::Shared;