Description
I wrote up some public and private strcuts, public methods, and traits in a module called structures.rs
In main.rs, I import structures.rs and write tests in its own separate module (within main.rs) using #[cfg(test)] and #[test] above each test method, which tests some public functions and structs from structures.rs
In both files, the fn main() only contains 1 println! statement.
Compiling both main.rs and structures.rs gives me a few warnings but no errors.
I try to run the unit tests using "cargo test" in the "src" folder of my crate but it doesn't act deterministically. Running "cargo test --verbose" errors with the message:
thread '<unnamed>' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libstd/thread/mod.rs:619:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.43.1 (8d69840ab 2020-05-04) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental
note: some of the compiler flags provided by cargo are hidden
thread 'rustc' panicked at 'src/librustc_codegen_ssa/back/write.rs:1754: panic during codegen/LLVM phase', src/librustc/util/bug.rs:37:26
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.43.1 (8d69840ab 2020-05-04) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental
note: some of the compiler flags provided by cargo are hidden
error: could not compile `ExprCalc`.
Caused by:
process didn't exit successfully: `rustc --crate-name ExprCalc --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C debuginfo=2 --test -C metadata=7d54c5c1fcb15878 -C extra-filename=-7d54c5c1fcb15878 --out-dir /home/rchuppala/ExpressionCalculator/ExprCalc/target/debug/deps -C incremental=/home/rchuppala/ExpressionCalculator/ExprCalc/target/debug/incremental -L dependency=/home/rchuppala/ExpressionCalculator/ExprCalc/target/debug/deps` (exit code: 101)
Other times, it works successfully and gives me the result of running the tests. I've done a variety of things, including reinstalling Rust and resourcing the path, and received continued undeterministic results (sometimes working, sometimes erring). Any advice?
rustc --version: rustc 1.43.1 (8d69840 2020-05-04)
system: linux CentOS