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::parser::{ParseResult, ParseState};
use crate::types::StringsInterner; use crate::types::StringsInterner;
use crate::{ use crate::{
Engine, ExclusiveRange, FnPtr, ImmutableString, InclusiveRange, OptimizationLevel, Position, Engine, ExclusiveRange, FnPtr, ImmutableString, InclusiveRange, Position, RhaiError,
RhaiError, SmartString, ERR, SmartString, ERR,
}; };
use std::any::type_name; use std::any::type_name;
#[cfg(feature = "no_std")] #[cfg(feature = "no_std")]
@ -288,7 +288,7 @@ impl Engine {
stream.peekable(), stream.peekable(),
&mut state, &mut state,
#[cfg(not(feature = "no_optimize"))] #[cfg(not(feature = "no_optimize"))]
OptimizationLevel::None, crate::OptimizationLevel::None,
#[cfg(feature = "no_optimize")] #[cfg(feature = "no_optimize")]
(), (),
)?; )?;

View File

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

View File

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

View File

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