Fix builds.

This commit is contained in:
Stephen Chung 2022-12-30 22:21:22 +08:00
parent ee8e745429
commit a478d57e01
3 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,6 @@
//! Module containing all deprecated API that will be removed in the next major version. //! Module containing all deprecated API that will be removed in the next major version.
use crate::func::RegisterNativeFunction; use crate::func::RegisterNativeFunction;
use crate::plugin::*;
use crate::types::dynamic::Variant; use crate::types::dynamic::Variant;
use crate::{ use crate::{
Dynamic, Engine, EvalAltResult, FnPtr, Identifier, ImmutableString, Module, NativeCallContext, Dynamic, Engine, EvalAltResult, FnPtr, Identifier, ImmutableString, Module, NativeCallContext,
@ -633,6 +632,9 @@ impl Module {
} }
} }
#[cfg(not(feature = "no_index"))]
use crate::plugin::*;
#[cfg(not(feature = "no_index"))] #[cfg(not(feature = "no_index"))]
#[export_module] #[export_module]
pub mod deprecated_array_functions { pub mod deprecated_array_functions {

View File

@ -66,14 +66,15 @@ impl Dynamic {
mx += 1; mx += 1;
match value.0 { match value.0 {
#[cfg(not(feature = "no_index"))]
Union::Array(ref a, ..) => { Union::Array(ref a, ..) => {
let (a, m, s) = Self::calc_array_sizes(a); let (a, m, s) = Self::calc_array_sizes(a);
ax += a; ax += a;
mx += m; mx += m;
sx += s; sx += s;
} }
#[cfg(not(feature = "no_index"))]
Union::Blob(ref a, ..) => ax += 1 + a.len(), Union::Blob(ref a, ..) => ax += 1 + a.len(),
#[cfg(not(feature = "no_object"))]
Union::Map(ref m, ..) => { Union::Map(ref m, ..) => {
let (a, m, s) = Self::calc_map_sizes(m); let (a, m, s) = Self::calc_map_sizes(m);
ax += a; ax += a;

View File

@ -371,6 +371,7 @@ impl FnPtr {
/// of arguments to call it directly (one version attaches extra arguments). /// of arguments to call it directly (one version attaches extra arguments).
#[cfg(not(feature = "internals"))] #[cfg(not(feature = "internals"))]
#[inline(always)] #[inline(always)]
#[allow(dead_code)]
pub(crate) fn call_raw_with_extra_args<const N: usize, const E: usize>( pub(crate) fn call_raw_with_extra_args<const N: usize, const E: usize>(
&self, &self,
fn_name: &str, fn_name: &str,