Skip to content

Repeated coercion ICE for an erroring indexing expression since 1.9. #40861

Closed
@eddyb

Description

@eddyb
fn f(_: &[f32]) {}
fn main() {
    ()[f(&[1.0])];
}
error: internal compiler error: /checkout/src/librustc_typeck/check/coercion.rs:693:
    expr already has an adjustment on it!

Regressed between 1.8 and 1.9 and found by @kennytm in #40610.
Like #40610, it only happens when there's already an error, possibly from a suggestion attempt.

Meta: perhaps there should be a label for ICE-on-error.

Metadata

Metadata

Assignees

Labels

I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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