mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Update test to not trigger stack overflow
This commit is contained in:
parent
cb6de47d3b
commit
776918971d
@ -1,19 +1,16 @@
|
||||
// edition: 2021
|
||||
// run-pass
|
||||
|
||||
async fn test(_arg: [u8; 8192]) {}
|
||||
async fn test(_arg: [u8; 16]) {}
|
||||
|
||||
async fn use_future(fut: impl std::future::Future<Output = ()>) {
|
||||
fut.await
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let actual = std::mem::size_of_val(&use_future(use_future(use_future(use_future(use_future(
|
||||
use_future(use_future(use_future(use_future(use_future(test(
|
||||
[0; 8192]
|
||||
))))))
|
||||
))))));
|
||||
// Not putting an exact number in case it slightly changes over different commits
|
||||
let expected = 8000000;
|
||||
let actual = std::mem::size_of_val(
|
||||
&use_future(use_future(use_future(use_future(use_future(test([0; 16])))))));
|
||||
// Not using an exact number in case it slightly changes over different commits
|
||||
let expected = 550;
|
||||
assert!(actual > expected, "expected: >{expected}, actual: {actual}");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user