From 5f36f1a28cd59d7d15b7fc84f5cfb1d495c8a7c5 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 29 May 2021 18:32:34 +0800 Subject: [PATCH] Remove PluginFunction::is_variadic. --- Cargo.toml | 2 +- codegen/Cargo.toml | 4 ++-- codegen/src/function.rs | 1 - codegen/src/test/function.rs | 8 -------- codegen/src/test/module.rs | 22 ---------------------- src/plugin.rs | 3 --- 6 files changed, 3 insertions(+), 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17c2861d..6151739d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ smallvec = { version = "1.6", default-features = false, features = ["union"] } ahash = { version = "0.7", default-features = false } num-traits = { version = "0.2", default_features = false } smartstring = { version = "0.2.6", default_features = false } -rhai_codegen = { version = "0.3.4", path = "codegen", default_features = false } +rhai_codegen = { version = "0.3.7", path = "codegen", default_features = false } [features] default = ["smartstring/std", "ahash/std", "num-traits/std"] # remove 'smartstring/std' when smartstring is updated to support no-std diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 284644a8..cfb9d004 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rhai_codegen" -version = "0.3.6" +version = "0.3.7" edition = "2018" authors = ["jhwgh1968", "Stephen Chung"] description = "Procedural macros support package for Rhai, a scripting language and engine for Rust" @@ -16,7 +16,7 @@ default = [] metadata = [] [dev-dependencies] -rhai = { path = "..", version = ">=0.19.15" } +rhai = { path = "..", version = ">=0.20.3" } trybuild = "1" [dependencies] diff --git a/codegen/src/function.rs b/codegen/src/function.rs index ccc97afa..178f3645 100644 --- a/codegen/src/function.rs +++ b/codegen/src/function.rs @@ -845,7 +845,6 @@ impl ExportedFn { } #[inline(always)] fn is_method_call(&self) -> bool { #is_method_call } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } } diff --git a/codegen/src/test/function.rs b/codegen/src/test/function.rs index 2013a120..7fb6dc3a 100644 --- a/codegen/src/test/function.rs +++ b/codegen/src/test/function.rs @@ -286,7 +286,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn() -> RhaiResult { @@ -322,7 +321,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn(x: usize) -> RhaiResult { @@ -358,7 +356,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn(context: NativeCallContext, x: usize) -> RhaiResult { @@ -396,7 +393,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn() -> RhaiResult { @@ -428,7 +424,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } }; @@ -460,7 +455,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn(x: usize, y: usize) -> RhaiResult { @@ -500,7 +494,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn(x: &mut usize, y: usize) -> RhaiResult { @@ -537,7 +530,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(unused)] #[inline(always)] pub fn dynamic_result_fn(message: &str) -> RhaiResult { diff --git a/codegen/src/test/module.rs b/codegen/src/test/module.rs index 959d2700..6e62c4a6 100644 --- a/codegen/src/test/module.rs +++ b/codegen/src/test/module.rs @@ -315,7 +315,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -370,7 +369,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -424,7 +422,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -492,7 +489,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } #[allow(non_camel_case_types)] @@ -510,7 +506,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -565,7 +560,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -627,7 +621,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -862,7 +855,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -947,7 +939,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1001,7 +992,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { false } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1057,7 +1047,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1114,7 +1103,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1174,7 +1162,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } #[allow(unused_imports)] @@ -1255,7 +1242,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } #[allow(unused_imports)] @@ -1337,7 +1323,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1398,7 +1383,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1457,7 +1441,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1519,7 +1502,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1578,7 +1560,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1640,7 +1621,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1700,7 +1680,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; @@ -1763,7 +1742,6 @@ mod generate_tests { } #[inline(always)] fn is_method_call(&self) -> bool { true } - #[inline(always)] fn is_variadic(&self) -> bool { false } } } }; diff --git a/src/plugin.rs b/src/plugin.rs index c183d736..73c2bb1d 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -25,7 +25,4 @@ pub trait PluginFunction { /// Is this plugin function a method? fn is_method_call(&self) -> bool; - - /// Is this plugin function variadic? - fn is_variadic(&self) -> bool; }