We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried this code:
#![allow(dead_code)] enum Kind { A, B, C, D, E, F, G, } const DATA_SIZE: usize = 1024 * 280; struct Data { data: [u8; DATA_SIZE], } fn data() -> Option<Data> { Some(Data { data: [0; DATA_SIZE], }) } fn test(kind: Kind) -> Option<Data> { match kind { Kind::A => Some(data()?), Kind::B => Some(data()?), Kind::C => Some(data()?), Kind::D => Some(data()?), Kind::E => Some(data()?), Kind::F => Some(data()?), Kind::G => Some(data()?), } } fn main() { let _ = test(Kind::A); println!("Done!"); }
Also see in playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6dbc4990244a9b4650b089c2c7996b34
I expected to see this happen: print Done!
Done!
Instead, this happened: stack overflow
rustc --version --verbose:
rustc --version --verbose
rustc 1.54.0-nightly (1c6868aa2 2021-05-27)
Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/example` thread 'main' has overflowed its stack fatal runtime error: stack overflow [1] 757 abort cargo run
The text was updated successfully, but these errors were encountered:
Duplicate of #34283
Sorry, something went wrong.
No branches or pull requests
I tried this code:
Also see in playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6dbc4990244a9b4650b089c2c7996b34
I expected to see this happen: print
Done!
Instead, this happened: stack overflow
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: