From da040a944ffa5d0001ed1610eb87a8eb2492c5ec Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 1 Feb 2024 12:25:40 +0800 Subject: [PATCH] Fix tests output. --- CHANGELOG.md | 2 +- codegen/ui_tests/export_fn_bad_attr.rs | 6 ++---- codegen/ui_tests/export_fn_bad_attr.stderr | 12 ++++++------ codegen/ui_tests/export_fn_bad_value.rs | 6 ++---- codegen/ui_tests/export_fn_bad_value.stderr | 12 ++++++------ codegen/ui_tests/export_fn_cfg.rs | 6 ++---- codegen/ui_tests/export_fn_cfg.stderr | 12 ++++++------ codegen/ui_tests/export_fn_extra_value.rs | 6 ++---- codegen/ui_tests/export_fn_extra_value.stderr | 12 ++++++------ codegen/ui_tests/export_fn_junk_arg.rs | 6 ++---- codegen/ui_tests/export_fn_junk_arg.stderr | 12 ++++++------ codegen/ui_tests/export_fn_missing_value.rs | 6 ++---- codegen/ui_tests/export_fn_missing_value.stderr | 12 ++++++------ codegen/ui_tests/export_fn_path_attr.rs | 6 ++---- codegen/ui_tests/export_fn_path_attr.stderr | 12 ++++++------ codegen/ui_tests/export_fn_raw_noreturn.rs | 6 ++---- codegen/ui_tests/export_fn_raw_noreturn.stderr | 12 ++++++------ codegen/ui_tests/export_fn_raw_return.rs | 6 ++---- codegen/ui_tests/export_fn_raw_return.stderr | 6 +++--- codegen/ui_tests/first_shared_ref.rs | 1 + codegen/ui_tests/first_shared_ref.stderr | 8 ++++---- codegen/ui_tests/non_clonable.rs | 1 + codegen/ui_tests/non_clonable.stderr | 8 ++++---- codegen/ui_tests/non_clonable_second.rs | 1 + codegen/ui_tests/non_clonable_second.stderr | 8 ++++---- codegen/ui_tests/return_mut_ref.rs | 2 ++ codegen/ui_tests/return_mut_ref.stderr | 8 ++++---- codegen/ui_tests/return_pointer.rs | 1 + codegen/ui_tests/return_pointer.stderr | 8 ++++---- codegen/ui_tests/return_shared_ref.rs | 1 + codegen/ui_tests/return_shared_ref.stderr | 8 ++++---- codegen/ui_tests/rhai_fn_non_clonable_return.rs | 1 + codegen/ui_tests/rhai_fn_non_clonable_return.stderr | 12 ++++++------ codegen/ui_tests/second_shared_ref.rs | 1 + codegen/ui_tests/second_shared_ref.stderr | 8 ++++---- 35 files changed, 113 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4e0ad1c..20635c3a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Version 1.18.0 Deprecated API's ---------------- -* The plugin macros `register_exported_fn!`, `set_exported_fn!` and `set_exported_global_fn!` are deprecated because they do not add value over existing direct API's. +* The plugin macros `export_fn`, `register_exported_fn!`, `set_exported_fn!` and `set_exported_global_fn!` are deprecated because they do not add value over existing direct API's. Enhancements ------------ diff --git a/codegen/ui_tests/export_fn_bad_attr.rs b/codegen/ui_tests/export_fn_bad_attr.rs index 685b8e883..3c5901f48 100644 --- a/codegen/ui_tests/export_fn_bad_attr.rs +++ b/codegen/ui_tests/export_fn_bad_attr.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_bad_attr.stderr b/codegen/ui_tests/export_fn_bad_attr.stderr index dadd08ea1..9e7ed6fdb 100644 --- a/codegen/ui_tests/export_fn_bad_attr.stderr +++ b/codegen/ui_tests/export_fn_bad_attr.stderr @@ -1,11 +1,11 @@ error: unknown attribute 'unknown' - --> ui_tests/export_fn_bad_attr.rs:9:13 - | -9 | #[export_fn(unknown = "thing")] - | ^^^^^^^ + --> ui_tests/export_fn_bad_attr.rs:10:13 + | +10 | #[export_fn(unknown = "thing")] + | ^^^^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_bad_attr.rs:19:8 + --> ui_tests/export_fn_bad_attr.rs:17:8 | -19 | if test_fn(n) { +17 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_bad_value.rs b/codegen/ui_tests/export_fn_bad_value.rs index f8044f9ce..07ce50a90 100644 --- a/codegen/ui_tests/export_fn_bad_value.rs +++ b/codegen/ui_tests/export_fn_bad_value.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_bad_value.stderr b/codegen/ui_tests/export_fn_bad_value.stderr index 08061ff72..3ec6d890b 100644 --- a/codegen/ui_tests/export_fn_bad_value.stderr +++ b/codegen/ui_tests/export_fn_bad_value.stderr @@ -1,11 +1,11 @@ error: expecting string literal - --> ui_tests/export_fn_bad_value.rs:9:20 - | -9 | #[export_fn(name = true)] - | ^^^^ + --> ui_tests/export_fn_bad_value.rs:10:20 + | +10 | #[export_fn(name = true)] + | ^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_bad_value.rs:19:8 + --> ui_tests/export_fn_bad_value.rs:17:8 | -19 | if test_fn(n) { +17 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_cfg.rs b/codegen/ui_tests/export_fn_cfg.rs index 52d4c963b..43e847afb 100644 --- a/codegen/ui_tests/export_fn_cfg.rs +++ b/codegen/ui_tests/export_fn_cfg.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -13,10 +14,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_cfg.stderr b/codegen/ui_tests/export_fn_cfg.stderr index 4bbee427d..498c95d4f 100644 --- a/codegen/ui_tests/export_fn_cfg.stderr +++ b/codegen/ui_tests/export_fn_cfg.stderr @@ -1,11 +1,11 @@ error: `cfg` attributes are not allowed for `export_fn` - --> ui_tests/export_fn_cfg.rs:9:1 - | -9 | #[cfg(not(feature = "foo"))] - | ^ + --> ui_tests/export_fn_cfg.rs:10:1 + | +10 | #[cfg(not(feature = "foo"))] + | ^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_cfg.rs:20:8 + --> ui_tests/export_fn_cfg.rs:18:8 | -20 | if test_fn(n) { +18 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_extra_value.rs b/codegen/ui_tests/export_fn_extra_value.rs index d8cb96233..34a635325 100644 --- a/codegen/ui_tests/export_fn_extra_value.rs +++ b/codegen/ui_tests/export_fn_extra_value.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_extra_value.stderr b/codegen/ui_tests/export_fn_extra_value.stderr index e526aa36f..5f0a86e4b 100644 --- a/codegen/ui_tests/export_fn_extra_value.stderr +++ b/codegen/ui_tests/export_fn_extra_value.stderr @@ -1,11 +1,11 @@ error: extraneous value - --> ui_tests/export_fn_extra_value.rs:9:26 - | -9 | #[export_fn(return_raw = "yes")] - | ^^^^^ + --> ui_tests/export_fn_extra_value.rs:10:26 + | +10 | #[export_fn(return_raw = "yes")] + | ^^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_extra_value.rs:19:8 + --> ui_tests/export_fn_extra_value.rs:17:8 | -19 | if test_fn(n) { +17 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_junk_arg.rs b/codegen/ui_tests/export_fn_junk_arg.rs index 3abb93994..72d4e4d19 100644 --- a/codegen/ui_tests/export_fn_junk_arg.rs +++ b/codegen/ui_tests/export_fn_junk_arg.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_junk_arg.stderr b/codegen/ui_tests/export_fn_junk_arg.stderr index 048d95ec4..973984e53 100644 --- a/codegen/ui_tests/export_fn_junk_arg.stderr +++ b/codegen/ui_tests/export_fn_junk_arg.stderr @@ -1,11 +1,11 @@ error: expecting identifier - --> ui_tests/export_fn_junk_arg.rs:9:13 - | -9 | #[export_fn("wheeeee")] - | ^^^^^^^^^ + --> ui_tests/export_fn_junk_arg.rs:10:13 + | +10 | #[export_fn("wheeeee")] + | ^^^^^^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_junk_arg.rs:19:8 + --> ui_tests/export_fn_junk_arg.rs:17:8 | -19 | if test_fn(n) { +17 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_missing_value.rs b/codegen/ui_tests/export_fn_missing_value.rs index 7497a5188..f06614d3d 100644 --- a/codegen/ui_tests/export_fn_missing_value.rs +++ b/codegen/ui_tests/export_fn_missing_value.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_missing_value.stderr b/codegen/ui_tests/export_fn_missing_value.stderr index c34a6a4b5..7e8b8e142 100644 --- a/codegen/ui_tests/export_fn_missing_value.stderr +++ b/codegen/ui_tests/export_fn_missing_value.stderr @@ -1,11 +1,11 @@ error: requires value - --> ui_tests/export_fn_missing_value.rs:9:13 - | -9 | #[export_fn(name)] - | ^^^^ + --> ui_tests/export_fn_missing_value.rs:10:13 + | +10 | #[export_fn(name)] + | ^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_missing_value.rs:19:8 + --> ui_tests/export_fn_missing_value.rs:17:8 | -19 | if test_fn(n) { +17 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_path_attr.rs b/codegen/ui_tests/export_fn_path_attr.rs index a9fed9e9c..e9984eb7d 100644 --- a/codegen/ui_tests/export_fn_path_attr.rs +++ b/codegen/ui_tests/export_fn_path_attr.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_path_attr.stderr b/codegen/ui_tests/export_fn_path_attr.stderr index a7862aeb1..3646601ed 100644 --- a/codegen/ui_tests/export_fn_path_attr.stderr +++ b/codegen/ui_tests/export_fn_path_attr.stderr @@ -1,11 +1,11 @@ error: expecting attribute name - --> ui_tests/export_fn_path_attr.rs:9:13 - | -9 | #[export_fn(rhai::name = "thing")] - | ^^^^ + --> ui_tests/export_fn_path_attr.rs:10:13 + | +10 | #[export_fn(rhai::name = "thing")] + | ^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_path_attr.rs:19:8 + --> ui_tests/export_fn_path_attr.rs:17:8 | -19 | if test_fn(n) { +17 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_raw_noreturn.rs b/codegen/ui_tests/export_fn_raw_noreturn.rs index 7c8b42e0f..09d4043cd 100644 --- a/codegen/ui_tests/export_fn_raw_noreturn.rs +++ b/codegen/ui_tests/export_fn_raw_noreturn.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: &mut Point) { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; test_fn(&mut n); if n.x >= 10.0 { println!("yes"); diff --git a/codegen/ui_tests/export_fn_raw_noreturn.stderr b/codegen/ui_tests/export_fn_raw_noreturn.stderr index 28744c613..29c12712c 100644 --- a/codegen/ui_tests/export_fn_raw_noreturn.stderr +++ b/codegen/ui_tests/export_fn_raw_noreturn.stderr @@ -1,11 +1,11 @@ error: functions marked with 'return_raw' must return Result> - --> ui_tests/export_fn_raw_noreturn.rs:9:13 - | -9 | #[export_fn(return_raw)] - | ^^^^^^^^^^ + --> ui_tests/export_fn_raw_noreturn.rs:10:13 + | +10 | #[export_fn(return_raw)] + | ^^^^^^^^^^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/export_fn_raw_noreturn.rs:19:5 + --> ui_tests/export_fn_raw_noreturn.rs:17:5 | -19 | test_fn(&mut n); +17 | test_fn(&mut n); | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/export_fn_raw_return.rs b/codegen/ui_tests/export_fn_raw_return.rs index 9df99549c..5ec1f609f 100644 --- a/codegen/ui_tests/export_fn_raw_return.rs +++ b/codegen/ui_tests/export_fn_raw_return.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] @@ -12,10 +13,7 @@ pub fn test_fn(input: Point) -> bool { } fn main() { - let n = Point { - x: 0.0, - y: 10.0, - }; + let n = Point { x: 0.0, y: 10.0 }; if test_fn(n) { println!("yes"); } else { diff --git a/codegen/ui_tests/export_fn_raw_return.stderr b/codegen/ui_tests/export_fn_raw_return.stderr index 629cda621..7fb2659ff 100644 --- a/codegen/ui_tests/export_fn_raw_return.stderr +++ b/codegen/ui_tests/export_fn_raw_return.stderr @@ -1,9 +1,9 @@ error[E0599]: `bool` is not an iterator - --> ui_tests/export_fn_raw_return.rs:10:33 + --> ui_tests/export_fn_raw_return.rs:11:33 | -9 | #[export_fn(return_raw)] +10 | #[export_fn(return_raw)] | ------------------------ in this procedural macro expansion -10 | pub fn test_fn(input: Point) -> bool { +11 | pub fn test_fn(input: Point) -> bool { | ^^^^ `bool` is not an iterator | = note: the following trait bounds were not satisfied: diff --git a/codegen/ui_tests/first_shared_ref.rs b/codegen/ui_tests/first_shared_ref.rs index f26fc40fe..0bcdd284b 100644 --- a/codegen/ui_tests/first_shared_ref.rs +++ b/codegen/ui_tests/first_shared_ref.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; struct NonClonable { diff --git a/codegen/ui_tests/first_shared_ref.stderr b/codegen/ui_tests/first_shared_ref.stderr index 440d865ad..462cfd2fe 100644 --- a/codegen/ui_tests/first_shared_ref.stderr +++ b/codegen/ui_tests/first_shared_ref.stderr @@ -1,11 +1,11 @@ error: references from Rhai in this position must be mutable - --> ui_tests/first_shared_ref.rs:11:23 + --> ui_tests/first_shared_ref.rs:12:23 | -11 | pub fn test_fn(input: &NonClonable) -> bool { +12 | pub fn test_fn(input: &NonClonable) -> bool { | ^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/first_shared_ref.rs:22:8 + --> ui_tests/first_shared_ref.rs:23:8 | -22 | if test_fn(n) { +23 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/non_clonable.rs b/codegen/ui_tests/non_clonable.rs index 69aa85ef8..269b3cee9 100644 --- a/codegen/ui_tests/non_clonable.rs +++ b/codegen/ui_tests/non_clonable.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; struct NonClonable { diff --git a/codegen/ui_tests/non_clonable.stderr b/codegen/ui_tests/non_clonable.stderr index 54d1f01c4..0d0bf012a 100644 --- a/codegen/ui_tests/non_clonable.stderr +++ b/codegen/ui_tests/non_clonable.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `NonClonable: Clone` is not satisfied - --> ui_tests/non_clonable.rs:11:23 + --> ui_tests/non_clonable.rs:12:23 | -11 | pub fn test_fn(input: NonClonable) -> bool { +12 | pub fn test_fn(input: NonClonable) -> bool { | ^^^^^^^^^^^ | | | the trait `Clone` is not implemented for `NonClonable` @@ -14,6 +14,6 @@ note: required by a bound in `rhai::Dynamic::cast` | ^^^^^ required by this bound in `Dynamic::cast` help: consider annotating `NonClonable` with `#[derive(Clone)]` | -3 + #[derive(Clone)] -4 | struct NonClonable { +4 + #[derive(Clone)] +5 | struct NonClonable { | diff --git a/codegen/ui_tests/non_clonable_second.rs b/codegen/ui_tests/non_clonable_second.rs index ef33d481d..614046354 100644 --- a/codegen/ui_tests/non_clonable_second.rs +++ b/codegen/ui_tests/non_clonable_second.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; struct NonClonable { diff --git a/codegen/ui_tests/non_clonable_second.stderr b/codegen/ui_tests/non_clonable_second.stderr index f0664785c..3d33ec5f2 100644 --- a/codegen/ui_tests/non_clonable_second.stderr +++ b/codegen/ui_tests/non_clonable_second.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `NonClonable: Clone` is not satisfied - --> ui_tests/non_clonable_second.rs:11:27 + --> ui_tests/non_clonable_second.rs:12:27 | -11 | pub fn test_fn(a: u32, b: NonClonable) -> bool { +12 | pub fn test_fn(a: u32, b: NonClonable) -> bool { | ^^^^^^^^^^^ | | | the trait `Clone` is not implemented for `NonClonable` @@ -14,6 +14,6 @@ note: required by a bound in `rhai::Dynamic::cast` | ^^^^^ required by this bound in `Dynamic::cast` help: consider annotating `NonClonable` with `#[derive(Clone)]` | -3 + #[derive(Clone)] -4 | struct NonClonable { +4 + #[derive(Clone)] +5 | struct NonClonable { | diff --git a/codegen/ui_tests/return_mut_ref.rs b/codegen/ui_tests/return_mut_ref.rs index 26b567948..1edf77b5b 100644 --- a/codegen/ui_tests/return_mut_ref.rs +++ b/codegen/ui_tests/return_mut_ref.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] diff --git a/codegen/ui_tests/return_mut_ref.stderr b/codegen/ui_tests/return_mut_ref.stderr index c1cc6faac..8f69c9b1d 100644 --- a/codegen/ui_tests/return_mut_ref.stderr +++ b/codegen/ui_tests/return_mut_ref.stderr @@ -1,11 +1,11 @@ error: Rhai functions cannot return references - --> ui_tests/return_mut_ref.rs:12:38 + --> ui_tests/return_mut_ref.rs:14:38 | -12 | pub fn test_fn(input: &mut Clonable) -> &mut bool { +14 | pub fn test_fn(input: &mut Clonable) -> &mut bool { | ^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/return_mut_ref.rs:23:8 + --> ui_tests/return_mut_ref.rs:25:8 | -23 | if test_fn(n) { +25 | if test_fn(n) { | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/return_pointer.rs b/codegen/ui_tests/return_pointer.rs index 302799bd0..86ac8310f 100644 --- a/codegen/ui_tests/return_pointer.rs +++ b/codegen/ui_tests/return_pointer.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] diff --git a/codegen/ui_tests/return_pointer.stderr b/codegen/ui_tests/return_pointer.stderr index 4405f82ce..c6674b4a4 100644 --- a/codegen/ui_tests/return_pointer.stderr +++ b/codegen/ui_tests/return_pointer.stderr @@ -1,11 +1,11 @@ error: Rhai functions cannot return pointers - --> ui_tests/return_pointer.rs:12:33 + --> ui_tests/return_pointer.rs:13:33 | -12 | pub fn test_fn(input: Clonable) -> *const str { +13 | pub fn test_fn(input: Clonable) -> *const str { | ^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/return_pointer.rs:24:19 + --> ui_tests/return_pointer.rs:25:19 | -24 | let ptr = test_fn(n); +25 | let ptr = test_fn(n); | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/return_shared_ref.rs b/codegen/ui_tests/return_shared_ref.rs index 2fde9c254..2ec4329f9 100644 --- a/codegen/ui_tests/return_shared_ref.rs +++ b/codegen/ui_tests/return_shared_ref.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] diff --git a/codegen/ui_tests/return_shared_ref.stderr b/codegen/ui_tests/return_shared_ref.stderr index 0a9be237d..01a1b2963 100644 --- a/codegen/ui_tests/return_shared_ref.stderr +++ b/codegen/ui_tests/return_shared_ref.stderr @@ -1,11 +1,11 @@ error: Rhai functions cannot return references - --> ui_tests/return_shared_ref.rs:12:33 + --> ui_tests/return_shared_ref.rs:13:33 | -12 | pub fn test_fn(input: Clonable) -> &'static str { +13 | pub fn test_fn(input: Clonable) -> &'static str { | ^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/return_shared_ref.rs:23:20 + --> ui_tests/return_shared_ref.rs:24:20 | -23 | println!("{}", test_fn(n)); +24 | println!("{}", test_fn(n)); | ^^^^^^^ not found in this scope diff --git a/codegen/ui_tests/rhai_fn_non_clonable_return.rs b/codegen/ui_tests/rhai_fn_non_clonable_return.rs index e2e2d7883..6cb0af128 100644 --- a/codegen/ui_tests/rhai_fn_non_clonable_return.rs +++ b/codegen/ui_tests/rhai_fn_non_clonable_return.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; struct NonClonable { diff --git a/codegen/ui_tests/rhai_fn_non_clonable_return.stderr b/codegen/ui_tests/rhai_fn_non_clonable_return.stderr index 48184f5af..da235fa9a 100644 --- a/codegen/ui_tests/rhai_fn_non_clonable_return.stderr +++ b/codegen/ui_tests/rhai_fn_non_clonable_return.stderr @@ -1,9 +1,9 @@ error[E0277]: the trait bound `NonClonable: Clone` is not satisfied - --> ui_tests/rhai_fn_non_clonable_return.rs:11:31 + --> ui_tests/rhai_fn_non_clonable_return.rs:12:31 | -10 | #[export_fn] +11 | #[export_fn] | ------------ in this procedural macro expansion -11 | pub fn test_fn(input: f32) -> NonClonable { +12 | pub fn test_fn(input: f32) -> NonClonable { | ^^^^^^^^^^^ the trait `Clone` is not implemented for `NonClonable` | note: required by a bound in `rhai::Dynamic::from` @@ -13,7 +13,7 @@ note: required by a bound in `rhai::Dynamic::from` | ^^^^^ required by this bound in `Dynamic::from` = note: this error originates in the attribute macro `export_fn` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `NonClonable` with `#[derive(Clone)]` - | -3 + #[derive(Clone)] -4 | struct NonClonable { + | +4 + #[derive(Clone)] +5 | struct NonClonable { | diff --git a/codegen/ui_tests/second_shared_ref.rs b/codegen/ui_tests/second_shared_ref.rs index 4768c0652..44ee5646d 100644 --- a/codegen/ui_tests/second_shared_ref.rs +++ b/codegen/ui_tests/second_shared_ref.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use rhai::plugin::*; #[derive(Clone)] diff --git a/codegen/ui_tests/second_shared_ref.stderr b/codegen/ui_tests/second_shared_ref.stderr index 814cd250d..1ef27bb81 100644 --- a/codegen/ui_tests/second_shared_ref.stderr +++ b/codegen/ui_tests/second_shared_ref.stderr @@ -1,11 +1,11 @@ error: function parameters other than the first one cannot be passed by reference - --> ui_tests/second_shared_ref.rs:12:41 + --> ui_tests/second_shared_ref.rs:13:41 | -12 | pub fn test_fn(input: Clonable, factor: &bool) -> bool { +13 | pub fn test_fn(input: Clonable, factor: &bool) -> bool { | ^ error[E0425]: cannot find function `test_fn` in this scope - --> ui_tests/second_shared_ref.rs:23:8 + --> ui_tests/second_shared_ref.rs:24:8 | -23 | if test_fn(n, &true) { +24 | if test_fn(n, &true) { | ^^^^^^^ not found in this scope