-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Running out of RAM during compilation #62637
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.Issue: Problems and improvements with respect to memory usage during compilation.P-mediumMedium priorityMedium priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.Issue: Problems and improvements with respect to memory usage during compilation.P-mediumMedium priorityMedium priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hi
Incorrectly closing the parentheses around an if expression causes the compiler to be stuck in endless recursion (probably), causing the computer to run out of memory.
I encountered this bug while trying to return
Some(if cond { ... } else { ... })from a function by accidentally placing the left parenthesis right after the if condition:Some(if ...) { } else { }.The code below is the minimal example I came up with that reproduces the bug. Please run it carefully since it rapidly consumes RAM (2 GB/s on my machine).
Compiler output:
Meta
The bug is present in both available for me compilers:
and
My OS is Arch Linux
5.1.11-arch1-1-ARCH.