Fix no_function build.
This commit is contained in:
parent
b4529b6a64
commit
cba914db95
@ -122,12 +122,12 @@ impl Engine {
|
|||||||
|
|
||||||
let statements = ast.statements();
|
let statements = ast.statements();
|
||||||
if !statements.is_empty() {
|
if !statements.is_empty() {
|
||||||
let lib = [
|
let lib: &[crate::Shared<crate::Module>] = &[
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
AsRef::<crate::Shared<_>>::as_ref(ast).clone(),
|
AsRef::<crate::Shared<crate::Module>>::as_ref(ast).clone(),
|
||||||
];
|
];
|
||||||
let lib = if lib.first().map_or(true, |m| m.is_empty()) {
|
let lib = if lib.first().map_or(true, |m| m.is_empty()) {
|
||||||
&lib[0..0]
|
&[][..]
|
||||||
} else {
|
} else {
|
||||||
&lib
|
&lib
|
||||||
};
|
};
|
||||||
|
@ -150,17 +150,15 @@ impl FnPtr {
|
|||||||
let mut arg_values = crate::StaticVec::new_const();
|
let mut arg_values = crate::StaticVec::new_const();
|
||||||
args.parse(&mut arg_values);
|
args.parse(&mut arg_values);
|
||||||
|
|
||||||
let lib = [
|
let lib: &[crate::Shared<crate::Module>] = &[
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
AsRef::<crate::Shared<_>>::as_ref(ast).clone(),
|
AsRef::<crate::Shared<crate::Module>>::as_ref(ast).clone(),
|
||||||
];
|
];
|
||||||
let lib = if lib.first().map_or(true, |m| m.is_empty()) {
|
let lib = if lib.first().map_or(true, |m| m.is_empty()) {
|
||||||
&lib[0..0]
|
&[][..]
|
||||||
} else {
|
} else {
|
||||||
&lib
|
&lib
|
||||||
};
|
};
|
||||||
#[cfg(feature = "no_function")]
|
|
||||||
let lib = &[];
|
|
||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
let ctx = NativeCallContext::new(engine, self.fn_name(), lib);
|
let ctx = NativeCallContext::new(engine, self.fn_name(), lib);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user