diff --git a/CHANGELOG.md b/CHANGELOG.md index cbae22d49..c3d31d2ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,17 +9,19 @@ Bug fixes * (Fuzzing) An integer-overflow bug from an inclusive range in the bits iterator is fixed. * (Fuzzing) An integer-underflow bug from an inclusive range is fixed. -* Copy strings if the strings interner is busy instead of panicing. +* Copy strings if the strings interner is busy instead of panicing (thanks [`@irevoire`](https://github.com/irevoire) [917](https://github.com/rhaiscript/rhai/pull/917)). +* Deserialization of `Scope` now works correctly (thanks [`@AngelicosPhosphoros`](https://github.com/AngelicosPhosphoros) [918](https://github.com/rhaiscript/rhai/pull/918)). +* Support for `thumbv6m` target is fixed (thanks [`chxry`](https://github.com/chxry) [919](https://github.com/rhaiscript/rhai/pull/919)) New features ------------ -* Added support for _raw strings_ with the syntax `##..#" ... "#..##`. +* Added support for _raw strings_ with the syntax `##..#" ... "#..##` (thanks [`@cellomath`](https://github.com/cellomath) [908](https://github.com/rhaiscript/rhai/pull/908) [910](https://github.com/rhaiscript/rhai/pull/910)). Enhancements ------------ -* New `as_immutable_string_ref`, `as_array_ref`, `as_blob_ref`, `as_map_ref` plus their `_mut` variants for `Dynamic`. +* New `as_immutable_string_ref`, `as_array_ref`, `as_blob_ref`, `as_map_ref` plus their `_mut` variants for `Dynamic` (thanks [`@madonuko`](https://github.com/madonuko) [904](https://github.com/rhaiscript/rhai/pull/904)). * The `break`, `return` and `throw` statements can now be simply used as `switch` case statement expressions. Previously it is required that the statement be wrapped in a block. diff --git a/Cargo.toml b/Cargo.toml index 8add432f4..ae329eabe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ rhai_codegen = { version = "2.1.0", path = "codegen" } no-std-compat = { git = "https://gitlab.com/jD91mZM2/no-std-compat", version = "0.4.1", default-features = false, features = ["alloc"], optional = true } libm = { version = "0.2.0", default-features = false, optional = true } -hashbrown = { version = "0.14.0", optional = true } +hashbrown = { version = "0.15.0", optional = true } core-error = { version = "0.0.0", default-features = false, features = ["alloc"], optional = true } serde = { version = "1.0.96", default-features = false, features = ["derive", "alloc"], optional = true } serde_json = { version = "1.0.45", default-features = false, features = ["alloc"], optional = true } diff --git a/codegen/src/test/custom_type.rs b/codegen/src/test/custom_type.rs index e18e36bc0..5da634677 100644 --- a/codegen/src/test/custom_type.rs +++ b/codegen/src/test/custom_type.rs @@ -10,7 +10,6 @@ mod custom_type_tests { #[derive(Clone, CustomType)] pub struct Bar( #[rhai_type(skip)] - #[cfg(not(feature = "no_float"))] rhai::FLOAT, INT, #[rhai_type(name = "boo", readonly)] @@ -49,7 +48,6 @@ mod custom_type_tests { #[derive(CustomType)] #[rhai_type(skip, name = "MyFoo", extra = Self::build_extra)] pub struct Foo { - #[cfg(not(feature = "no_float"))] #[rhai_type(skip)] _dummy: rhai::FLOAT, #[rhai_type(get = get_bar)] @@ -100,7 +98,6 @@ mod custom_type_tests { #[derive(Clone, CustomType)] pub struct Bar( #[rhai_type(skip)] - #[cfg(not(feature = "no_float"))] rhai::FLOAT, INT, /// boo comments. @@ -143,7 +140,6 @@ mod custom_type_tests { #[derive(CustomType)] #[rhai_type(skip, name = "MyFoo", extra = Self::build_extra)] pub struct Foo { - #[cfg(not(feature = "no_float"))] #[rhai_type(skip)] _dummy: rhai::FLOAT, #[rhai_type(get = get_bar)] diff --git a/codegen/src/test/module.rs b/codegen/src/test/module.rs index 39d2374c6..34097b1c4 100644 --- a/codegen/src/test/module.rs +++ b/codegen/src/test/module.rs @@ -1470,7 +1470,6 @@ mod generate_tests { fn one_fn_with_cfg_module() { let input_tokens: TokenStream = quote! { pub mod one_fn { - #[cfg(not(feature = "no_float"))] pub mod it_is { pub fn increment(x: &mut FLOAT) { *x += 1.0 as FLOAT; @@ -1482,7 +1481,6 @@ mod generate_tests { let expected_tokens = quote! { #[allow(clippy::needless_pass_by_value, clippy::needless_pass_by_ref_mut)] pub mod one_fn { - #[cfg(not(feature = "no_float"))] #[allow(clippy::needless_pass_by_value, clippy::needless_pass_by_ref_mut)] pub mod it_is { pub fn increment(x: &mut FLOAT) { @@ -1541,10 +1539,8 @@ mod generate_tests { #[inline(always)] pub fn rhai_generate_into_module(_m: &mut Module, _flatten: bool) { if _flatten { - #[cfg(not(feature = "no_float"))] self::it_is::rhai_generate_into_module(_m, _flatten); } else { - #[cfg(not(feature = "no_float"))] _m.set_sub_module("it_is", self::it_is::rhai_module_generate()); } } diff --git a/codegen/tests/test_custom_type.rs b/codegen/tests/test_custom_type.rs index 4e748aa7c..75e3f9d79 100644 --- a/codegen/tests/test_custom_type.rs +++ b/codegen/tests/test_custom_type.rs @@ -4,9 +4,7 @@ use rhai::{CustomType, Engine, TypeBuilder, INT}; #[derive(Clone, CustomType)] pub struct Bar( - #[rhai_type(skip)] - #[cfg(not(feature = "no_float"))] // check other attributes - rhai::FLOAT, + #[rhai_type(skip)] rhai::FLOAT, INT, #[rhai_type(name = "boo", readonly)] String, Vec, @@ -15,7 +13,6 @@ pub struct Bar( #[derive(Clone, Default, CustomType)] #[rhai_type(name = "MyFoo", extra = Self::build_extra)] pub struct Foo { - #[cfg(not(feature = "no_float"))] // check other attributes #[rhai_type(skip)] _dummy: rhai::FLOAT, #[rhai_type(get = get_bar)] diff --git a/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr b/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr index 8fb2f445f..a137858e0 100644 --- a/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr +++ b/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr @@ -9,7 +9,11 @@ note: found an item that was configured out | 12 | pub mod test_mod { | ^^^^^^^^ - = note: the item is gated behind the `unset_feature` feature +note: the item is gated behind the `unset_feature` feature + --> ui_tests/rhai_mod_inner_cfg_false.rs:11:11 + | +11 | #[cfg(feature = "unset_feature")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unexpected `cfg` condition value: `unset_feature` --> ui_tests/rhai_mod_inner_cfg_false.rs:11:11 diff --git a/codegen/ui_tests/rhai_mod_unknown_type.stderr b/codegen/ui_tests/rhai_mod_unknown_type.stderr index 4dc1005e8..c33f0d8ea 100644 --- a/codegen/ui_tests/rhai_mod_unknown_type.stderr +++ b/codegen/ui_tests/rhai_mod_unknown_type.stderr @@ -11,9 +11,7 @@ help: a struct with a similar name exists | 12 | pub fn test_fn(input: Point) -> bool { | ~~~~~ -help: consider importing one of these items - | -11 + use core::fmt::Pointer; +help: consider importing this trait | 11 + use std::fmt::Pointer; |