@@ -25,7 +25,7 @@ pub(crate) mod prelude {
25
25
pub ( crate ) use crate :: tests:: { eval, run} ;
26
26
pub ( crate ) use crate :: {
27
27
from_value, prepare, sources, span, vm_try, Any , Context , ContextError , Diagnostics ,
28
- FromValue , Hash , Item , ItemBuf , Module , Options , Source , Sources , Value , Vm ,
28
+ FromValue , Hash , Item , ItemBuf , Module , Source , Sources , Value , Vm ,
29
29
} ;
30
30
pub ( crate ) use futures_executor:: block_on;
31
31
@@ -43,7 +43,7 @@ use ::rust_alloc::sync::Arc;
43
43
44
44
use anyhow:: { Context as _, Error , Result } ;
45
45
46
- use crate :: runtime:: { Args , VmError } ;
46
+ use crate :: runtime:: { GuardedArgs , VmError } ;
47
47
use crate :: {
48
48
alloc, termcolor, BuildError , Context , Diagnostics , FromValue , Hash , Options , Source , Sources ,
49
49
Unit , Vm ,
@@ -149,24 +149,21 @@ pub fn run_helper<T>(
149
149
context : & Context ,
150
150
sources : & mut Sources ,
151
151
diagnostics : & mut Diagnostics ,
152
- args : impl Args ,
152
+ args : impl GuardedArgs ,
153
153
script : bool ,
154
154
) -> Result < T , TestError >
155
155
where
156
156
T : FromValue ,
157
157
{
158
158
let mut vm = vm ( context, sources, diagnostics, script) ?;
159
159
160
- let mut execute = if script {
161
- vm. execute ( Hash :: EMPTY , args) . map_err ( TestError :: VmError ) ?
160
+ let result = if script {
161
+ :: futures_executor :: block_on ( vm. async_call ( Hash :: EMPTY , args) )
162
162
} else {
163
- vm. execute ( [ "main" ] , args) . map_err ( TestError :: VmError ) ?
163
+ :: futures_executor :: block_on ( vm. async_call ( [ "main" ] , args) )
164
164
} ;
165
165
166
- let output = :: futures_executor:: block_on ( execute. async_complete ( ) )
167
- . into_result ( )
168
- . map_err ( TestError :: VmError ) ?;
169
-
166
+ let output = result. map_err ( TestError :: VmError ) ?;
170
167
crate :: from_value ( output) . map_err ( |error| TestError :: VmError ( error. into ( ) ) )
171
168
}
172
169
@@ -180,7 +177,7 @@ pub fn sources(source: &str) -> Sources {
180
177
}
181
178
182
179
/// Run the given source with diagnostics being printed to stderr.
183
- pub fn run < T > ( context : & Context , source : & str , args : impl Args , script : bool ) -> Result < T >
180
+ pub fn run < T > ( context : & Context , source : & str , args : impl GuardedArgs , script : bool ) -> Result < T >
184
181
where
185
182
T : FromValue ,
186
183
{
@@ -487,6 +484,7 @@ mod getter_setter;
487
484
mod iterator;
488
485
#[ cfg( not( miri) ) ]
489
486
mod macros;
487
+ mod matching;
490
488
#[ cfg( not( miri) ) ]
491
489
mod moved;
492
490
#[ cfg( not( miri) ) ]
0 commit comments