File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ fn find_assembly(
55 env : & str ,
66 masm : bool ,
77) -> Option < ( & ' static str , bool ) > {
8- println ! ( "cargo:rustc-check-cfg=cfg(switchable_stack,asm,link_asm)" ) ;
98 match ( arch, endian, os, env) {
109 // The implementations for stack switching exist, but, officially, doing so without Fibers
1110 // is not supported in Windows. For x86_64 the implementation actually works locally,
@@ -58,6 +57,13 @@ fn find_assembly(
5857fn main ( ) {
5958 use std:: env:: var;
6059
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+
6167 let arch = var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ;
6268 let env = var ( "CARGO_CFG_TARGET_ENV" ) . unwrap ( ) ;
6369 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! {
268268 no {
269269 #[ cfg( not( windows) ) ]
270270 fn _grow( stack_size: usize , callback: & mut dyn FnMut ( ) ) {
271- drop ( stack_size) ;
271+ let _ = stack_size;
272272 callback( ) ;
273273 }
274274 }
275275}
276276
277277cfg_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) ] {
279285 use std:: ptr;
280286 use std:: io;
281287 use libc:: c_void;
You can’t perform that action at this time.
0 commit comments