-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Cargo check runs forever and memory usage grows unboundedly #116914
Copy link
Copy link
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Apologies, I really couldn't find a way to minimise this example, but this commit causes
cargo checkto run forever and consume an ever-growing amount of memory. I tried to narrow down what was causing the problem, but just pulling the various trait definitions out into another crate didn't reproduce it. I think the issue is related to (almost certainly) poorly-defined associated type bounds in the various traits undersrc/proxy/routes, as it seemed to start happening after I started adding those, but I'm really not very confident in that assessment.I expected to see this happen:
cargo checkwould run in a bounded amount of space and timeInstead, this happened:
cargo checkseems to run forever and consume all of my memoryI can confirm the issue occurs on both nightly and stable, with versions:
rustc --version --verbose:rustc --version --verbose:I can't include a backtrace because, naturally, the compiler doesn't exit, so setting
RUST_BACKTRACE=1has no effectThis is a screenshot of rustc consuming 23GB of ram while compiling the linked commit. I don't know why I thought this would be useful, but I guess I did, so here it is.
