rustc OOM due to syntax error

Created on 2 Oct 2020  路  4Comments  路  Source: rust-lang/rust


It's just missing a comma after Self::Word but this ends up consuming all memory on my machine (and on the rust playground). It's worth noting that reducing the level of indentation also seems to sidestep this issue.

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=16aba66ebd0c4177caa5498417f83878

Code


pub trait UNWArch {
    fn method(
                               addr: Self::Word
                               data: *mut c_void
    );
}

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-unknown-linux-gnu
release: 1.46.0
LLVM version: 10.0

Error output

cargo build
   Compiling fail v0.1.0 (/home/crzysdrs/fail)
error: could not compile `fail`.

Caused by:
  process didn't exit successfully: `rustc --crate-name fail --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=c63edfe5a60da69f -C extra-filename=-c63edfe5a60da69f --out-dir /home/crzysdrs/fail/target/debug/deps -C incremental=/home/crzysdrs/fail/target/debug/incremental -L dependency=/home/crzysdrs/fail/target/debug/deps` (signal: 9, SIGKILL: kill)


Backtrace

No backtrace, process terminated.

C-bug I-compilemem I-crash T-compiler regression-from-stable-to-stable

All 4 comments

This seems to have been fixed in nightly. It seems like it was introduced in 1.46 and will be present in 1.47, unless we indentify and a backport the fix present in nightly.

Nominated the PR for beta backport so this issue does not appear in 1.47.

Closing as this issue is fixed on nightly and the fix is now beta-accepted.

Was this page helpful?
0 / 5 - 0 ratings