Improve proc macro hygiene
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
struct NonClonable {
|
||||
a: f32,
|
||||
|
@@ -5,7 +5,7 @@ error: references from Rhai in this position must be mutable
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error[E0425]: cannot find function `test_fn` in this scope
|
||||
--> $DIR/first_shared_ref.rs:17:8
|
||||
--> $DIR/first_shared_ref.rs:22:8
|
||||
|
|
||||
17 | if test_fn(n) {
|
||||
22 | if test_fn(n) {
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
struct NonClonable {
|
||||
a: f32,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
struct NonClonable {
|
||||
a: f32,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Clonable {
|
||||
|
@@ -5,7 +5,7 @@ error: cannot return a reference to Rhai
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error[E0425]: cannot find function `test_fn` in this scope
|
||||
--> $DIR/return_mut_ref.rs:18:8
|
||||
--> $DIR/return_mut_ref.rs:23:8
|
||||
|
|
||||
18 | if test_fn(n) {
|
||||
23 | if test_fn(n) {
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Clonable {
|
||||
|
@@ -5,7 +5,7 @@ error: cannot return a pointer to Rhai
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0425]: cannot find function `test_fn` in this scope
|
||||
--> $DIR/return_pointer.rs:18:39
|
||||
--> $DIR/return_pointer.rs:24:19
|
||||
|
|
||||
18 | println!("{}", unsafe { let ptr = test_fn(n); *ptr });
|
||||
| ^^^^^^^ not found in this scope
|
||||
24 | let ptr = test_fn(n);
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Clonable {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
error: cannot return a reference to Rhai
|
||||
--> $DIR/return_shared_ref.rs:12:33
|
||||
|
|
||||
12 | pub fn test_fn(input: Clonable) -> & 'static str {
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
12 | pub fn test_fn(input: Clonable) -> &'static str {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0425]: cannot find function `test_fn` in this scope
|
||||
--> $DIR/return_shared_ref.rs:18:20
|
||||
--> $DIR/return_shared_ref.rs:23:20
|
||||
|
|
||||
18 | println!("{}", test_fn(n));
|
||||
23 | println!("{}", test_fn(n));
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use rhai::export_fn;
|
||||
use rhai::plugin::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Clonable {
|
||||
|
@@ -5,7 +5,7 @@ error: this type in this position passes from Rhai by value
|
||||
| ^^^^^
|
||||
|
||||
error[E0425]: cannot find function `test_fn` in this scope
|
||||
--> $DIR/second_shared_ref.rs:18:8
|
||||
--> $DIR/second_shared_ref.rs:23:8
|
||||
|
|
||||
18 | if test_fn(n, &true) {
|
||||
23 | if test_fn(n, &true) {
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
Reference in New Issue
Block a user