4 ms·
You'll get error[E0381]: borrow of possibly uninitialized variable: `huge_ary` --> src/main.rs:6:7 | 6 | bar(&huge_ary); | ^^^
by estebank 8y ago
You'll get
error[E0381]: borrow of possibly uninitialized variable: `huge_ary`
--> src/main.rs:6:7
|
6 | bar(&huge_ary);
| ^^^^^^^^^ use of possibly uninitialized `huge_ary`
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=49d82e946bd933ff8af80a4ed2345c1e https://play.rust-lang.org/?version=nightly&mode=debug&editi...
- eridius 8y agoYou're not supposed to use the array, it's just supposed to exist on the stack. I'm not sure how to ensure the stack space isn't reclaimed; maybe we can do something with declaring it up top, then putting the `if` that initializes it later on, and hope the compiler still reserves the stack space for huge_ary ahead of stack for other variables?