File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ fn find_assembly(
5
5
env : & str ,
6
6
masm : bool ,
7
7
) -> Option < ( & ' static str , bool ) > {
8
- println ! ( "cargo:rustc-check-cfg=cfg(switchable_stack,asm,link_asm)" ) ;
9
8
match ( arch, endian, os, env) {
10
9
// The implementations for stack switching exist, but, officially, doing so without Fibers
11
10
// is not supported in Windows. For x86_64 the implementation actually works locally,
@@ -58,6 +57,13 @@ fn find_assembly(
58
57
fn main ( ) {
59
58
use std:: env:: var;
60
59
60
+ println ! ( "cargo:rustc-check-cfg=cfg(switchable_stack,asm,link_asm)" ) ;
61
+
62
+ if var ( "CARGO_CFG_MIRI" ) . is_ok ( ) {
63
+ // Miri doesn't have a stack limit and the inline asm wouldn't work on miri anyway.
64
+ return ;
65
+ }
66
+
61
67
let arch = var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ;
62
68
let env = var ( "CARGO_CFG_TARGET_ENV" ) . unwrap ( ) ;
63
69
let os = var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -268,14 +268,20 @@ psm_stack_manipulation! {
268
268
no {
269
269
#[ cfg( not( windows) ) ]
270
270
fn _grow( stack_size: usize , callback: & mut dyn FnMut ( ) ) {
271
- drop ( stack_size) ;
271
+ let _ = stack_size;
272
272
callback( ) ;
273
273
}
274
274
}
275
275
}
276
276
277
277
cfg_if ! {
278
- if #[ cfg( windows) ] {
278
+ if #[ cfg( miri) ] {
279
+ // Miri doesn't have a stack limit
280
+ #[ inline( always) ]
281
+ unsafe fn guess_os_stack_limit( ) -> Option <usize > {
282
+ None
283
+ }
284
+ } else if #[ cfg( windows) ] {
279
285
use std:: ptr;
280
286
use std:: io;
281
287
use libc:: c_void;
You can’t perform that action at this time.
0 commit comments