From c95f08affac33aa86c9c39110e7d717d2a5e3d33 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 18 Mar 2020 13:35:46 +0100 Subject: [PATCH] increase stack slack for x86_64-pc-windows-gnu --- src/test/ui/issues/issue-40883.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/ui/issues/issue-40883.rs b/src/test/ui/issues/issue-40883.rs index 5a51acc73e8..8a4aef46dd5 100644 --- a/src/test/ui/issues/issue-40883.rs +++ b/src/test/ui/issues/issue-40883.rs @@ -71,15 +71,16 @@ pub fn supersize_me(out: &mut Vec) { #[inline(never)] fn verify_stack_usage(before_ptr: *mut Vec) { - // to check stack usage, create locals before and after + // To check stack usage, create locals before and after // and check the difference in addresses between them. let mut stack_var: Vec = vec![]; test::black_box(&mut stack_var); let stack_usage = isize::abs( (&mut stack_var as *mut _ as isize) - (before_ptr as isize)) as usize; - // give space for 2 copies of `Big` + 256 "misc" bytes. - if stack_usage > mem::size_of::() * 2 + 256 { + // Give space for 2 copies of `Big` + 272 "misc" bytes + // (value observed on x86_64-pc-windows-gnu). + if stack_usage > mem::size_of::() * 2 + 272 { panic!("used {} bytes of stack, but `struct Big` is only {} bytes", stack_usage, mem::size_of::()); }