Skip to content

Slow compile times for promotion of [(); usize::MAX] #77062

Closed

Description

I tried this code:

fn main() {
    let _ = &[(); usize::MAX];
}

I expected to see this happen: code compiles in a reasonable amount of times or the slice gets elided entirely.

Instead, this happened: code takes multiple minutes to compile/gets killed by the playground.

Meta

rustc --version --verbose:

rustc 1.48.0-nightly (9b4154193 2020-09-14)
binary: rustc
commit-hash: 9b4154193e8471f36b1a9e781f1ef7d492fc6a6c
commit-date: 2020-09-14
host: x86_64-pc-windows-msvc
release: 1.48.0-nightly
LLVM version: 11.0

Also tested on playground stable and nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation (MIR interpretation)C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-compilememIssue: Problems and improvements with respect to memory usage during compilation.I-compiletimeIssue: Problems and improvements with respect to compile times.P-mediumMedium priorityT-compilerRelevant 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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions