Description
I tried initializing a private field from a wrapper struct pub struct Foo(/*private fields*/)
that is defined in another crate, and Rust started to eat all my system memory, until I was forced to restart the computer.
Unfortunately the code that caused this from my side is closed source, but I was trying to initialize the Extensions
struct like this:
let extensions = Extensions(
license
.certificate
.iter_extensions()
.cloned()
.collect::<Vec<_>>(),
);
I expected to see this happen:
Either a compiler crash or just the compiler giving me an error saying that you can't do that!
Instead, this happened:
System memory usage kept going up and up, until it crashed my pc. Limiting cargo check
memory usage just meant that the process was killed, so no error messages either.
Meta
rustc --version --verbose
:
rustc 1.76.0-nightly (1fdfe1234 2023-12-06)
binary: rustc
commit-hash: 1fdfe1234795a289af1088aefa92ef80191cb611
commit-date: 2023-12-06
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5
I've also tried (and got the same results) nightly-2024-01-05
.
We got this issue in 3 different systems, 2 being linux x64 and one being macos (with the m1/2 arch, whatever that is called).
Backtrace
No backtrace, rust didn't produce any error output, it just got stuck in checking {crate-name}
forever.
<backtrace>