Fine tune codegen for global exports.

This commit is contained in:
Stephen Chung
2020-11-17 14:29:28 +08:00
parent bd094d95b4
commit 863c6b45a5
5 changed files with 23 additions and 18 deletions

View File

@@ -9,7 +9,7 @@ pub struct Point {
#[export_module]
pub mod test_module {
pub use super::Point;
#[rhai_fn(global, global)]
#[rhai_fn(global, internal)]
pub fn test_fn(input: Point) -> bool {
input.x > input.y
}

View File

@@ -1,8 +1,8 @@
error: conflicting namespace
--> $DIR/rhai_fn_global_multiple.rs:12:23
|
12 | #[rhai_fn(global, global)]
| ^^^^^^
12 | #[rhai_fn(global, internal)]
| ^^^^^^^^
error[E0433]: failed to resolve: use of undeclared crate or module `test_module`
--> $DIR/rhai_fn_global_multiple.rs:23:8