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'm trying to make an example showing the struct update format similar to https://rust-book.cs.brown.edu/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax but rustc is overflowing its stack.
struct Course { department: String, number: i32, section: i32, instructor: String, } fn new_course(department: &str, number: i32) -> Course { Course { department: department.to_string(), number, // No need to write number: number section: 1, instructor: String::from("Staff"), } } fn main() { let cs241 = new_course("CSCI", 241); let cs241_2 = Course { instructor: String::from("Stephen Checkoway"), section: 2, ..cs241 }; }
stderr:
thread 'rustc' has overflowed its stack fatal runtime error: stack overflow error: could not compile `aquascope_tmp_proj` (bin "aquascope_tmp_proj") Caused by: process didn't exit successfully: `/usr/local/cargo/bin/aquascope-driver /usr/local/rustup/toolchains/nightly-2023-08-25-x86_64-unknown-linux-musl/bin/rustc --crate-name aquascope_tmp_proj --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=eac331abf253eb57 -C extra-filename=-eac331abf253eb57 --out-dir /app/aquascope_tmp_proj/target/plugin-nightly-2023-08-25/debug/deps -C incremental=/app/aquascope_tmp_proj/target/plugin-nightly-2023-08-25/debug/incremental -L dependency=/app/aquascope_tmp_proj/target/plugin-nightly-2023-08-25/debug/deps -C target-feature=-crt-static` (signal: 6, SIGABRT: process abort signal)
The text was updated successfully, but these errors were encountered:
Hi @stevecheckoway, thanks for the report. You're running into two unimplemented features:
(Obviously the stack overflow is not great DX for making you aware of these things ^^)
These are things we intend to implement, time-permitting. For now, you can make your program work by avoiding both limitations if you rewrite:
let cs241 = new_course("CSCI", 241);
To:
let department = String::from("CSCI"); let cs241 = new_course(&department, 241);
This generates a working diagram:
Sorry, something went wrong.
Ah great. Thanks for explaining that this is a known limitation.
And thank you for this great tool!
No branches or pull requests
I'm trying to make an example showing the struct update format similar to https://rust-book.cs.brown.edu/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax but rustc is overflowing its stack.
stderr:
The text was updated successfully, but these errors were encountered: