Fix volatile warnings.

This commit is contained in:
Stephen Chung 2021-01-16 14:46:03 +08:00
parent e6c6ed759f
commit 65621b79b1
5 changed files with 24 additions and 22 deletions

View File

@ -60,7 +60,7 @@ impl FnAccess {
/// _(INTERNALS)_ A type containing information on a scripted function.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone)]
@ -273,8 +273,10 @@ impl AST {
pub(crate) fn shared_lib(&self) -> Shared<Module> {
self.functions.clone()
}
/// Get the internal shared [`Module`] containing all script-defined functions.
/// _(INTERNALS)_ Get the internal shared [`Module`] containing all script-defined functions.
/// Exported under the `internals` feature only.
#[cfg(feature = "internals")]
#[deprecated = "this method is volatile and may change"]
#[cfg(not(feature = "no_module"))]
#[cfg(not(feature = "no_function"))]
#[inline(always)]
@ -764,7 +766,7 @@ impl AsRef<Module> for AST {
/// _(INTERNALS)_ An identifier containing an [immutable string][ImmutableString] name and a [position][Position].
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Clone, Eq, PartialEq, Hash)]
@ -785,7 +787,7 @@ impl fmt::Debug for Ident {
/// _(INTERNALS)_ A type encapsulating the mode of a `return`/`throw` statement.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
@ -799,7 +801,7 @@ pub enum ReturnType {
/// _(INTERNALS)_ An [`AST`] node, consisting of either an [`Expr`] or a [`Stmt`].
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Hash)]
@ -823,7 +825,7 @@ impl<'a> From<&'a Expr> for ASTNode<'a> {
/// _(INTERNALS)_ A statement.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Hash)]
@ -1070,7 +1072,7 @@ impl Stmt {
/// _(INTERNALS)_ A custom syntax expression.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Hash)]
@ -1086,7 +1088,7 @@ pub struct CustomExpr {
/// _(INTERNALS)_ A binary expression.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Hash)]
@ -1100,7 +1102,7 @@ pub struct BinaryExpr {
/// _(INTERNALS)_ A function call.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Default, Hash)]
@ -1195,7 +1197,7 @@ impl FloatWrapper {
/// _(INTERNALS)_ An expression sub-tree.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Hash)]

View File

@ -45,7 +45,7 @@ pub const TYPICAL_MAP_SIZE: usize = 8; // Small maps are typical
/// _(INTERNALS)_ A stack of imported [modules][Module].
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
//
@ -498,7 +498,7 @@ impl<T: Into<Dynamic>> From<T> for Target<'_> {
/// _(INTERNALS)_ A type that holds all the current states of the [`Engine`].
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Default)]
@ -538,7 +538,7 @@ impl State {
/// _(INTERNALS)_ A type containing all the limits imposed by the [`Engine`].
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[cfg(not(feature = "unchecked"))]

View File

@ -2004,7 +2004,7 @@ impl Module {
/// A [`StaticVec`] is used because most namespace-qualified access contains only one level,
/// and it is wasteful to always allocate a [`Vec`] with one element.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Clone, Eq, PartialEq, Default, Hash)]

View File

@ -11,7 +11,7 @@ use crate::{EvalAltResult, Position};
/// _(INTERNALS)_ Error encountered when tokenizing the script text.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Eq, PartialEq, Clone, Hash)]

View File

@ -150,7 +150,7 @@ impl fmt::Debug for Position {
/// _(INTERNALS)_ A Rhai language token.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, PartialEq, Clone)]
@ -742,7 +742,7 @@ impl From<Token> for String {
/// _(INTERNALS)_ State of the tokenizer.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This type is volatile and may change.
#[derive(Debug, Clone, Eq, PartialEq, Default)]
@ -764,7 +764,7 @@ pub struct TokenizeState {
/// _(INTERNALS)_ Trait that encapsulates a peekable character input stream.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile Data Structure
///
/// This trait is volatile and may change.
pub trait InputStream {
@ -781,9 +781,9 @@ pub trait InputStream {
/// _(INTERNALS)_ Parse a string literal wrapped by `enclosing_char`.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile API
///
/// This type is volatile and may change.
/// This function is volatile and may change.
pub fn parse_string_literal(
stream: &mut impl InputStream,
state: &mut TokenizeState,
@ -976,9 +976,9 @@ fn scan_block_comment(
/// _(INTERNALS)_ Get the next token from the `stream`.
/// Exported under the `internals` feature only.
///
/// # WARNING
/// # Volatile API
///
/// This type is volatile and may change.
/// This function is volatile and may change.
#[inline]
pub fn get_next_token(
stream: &mut impl InputStream,