Fix diagnostic messages.

This commit is contained in:
Stephen Chung 2023-01-30 13:03:47 +08:00
parent 6400b33b1b
commit 08f428def2
4 changed files with 6 additions and 3 deletions

View File

@ -3,8 +3,8 @@ use crate::packages::iter_basic::{BitRange, CharsStream, StepRange};
use crate::parser::{ParseResult, ParseState};
use crate::types::StringsInterner;
use crate::{
Engine, ExclusiveRange, FnPtr, ImmutableString, InclusiveRange, OptimizationLevel, Position,
RhaiError, SmartString, ERR,
Engine, ExclusiveRange, FnPtr, ImmutableString, InclusiveRange, Position, RhaiError,
SmartString, ERR,
};
use std::any::type_name;
#[cfg(feature = "no_std")]
@ -288,7 +288,7 @@ impl Engine {
stream.peekable(),
&mut state,
#[cfg(not(feature = "no_optimize"))]
OptimizationLevel::None,
crate::OptimizationLevel::None,
#[cfg(feature = "no_optimize")]
(),
)?;

View File

@ -51,6 +51,7 @@ fn main() {
};
// Initialize scripting engine
#[allow(unused_mut)]
let mut engine = Engine::new();
#[cfg(not(feature = "no_optimize"))]

View File

@ -543,6 +543,7 @@ impl Engine {
let op_pos = parent.position();
#[cfg(feature = "debugging")]
#[allow(unused_mut)]
let mut this_ptr = this_ptr;
match ChainType::from(parent) {

View File

@ -71,6 +71,7 @@ impl FnPtr {
/// Create a new function pointer without checking its parameters.
#[inline(always)]
#[must_use]
#[allow(dead_code)]
pub(crate) fn new_unchecked(
name: impl Into<ImmutableString>,
curry: StaticVec<Dynamic>,