Skip to content

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

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.

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    on Mar 27, 2017
  2. self-assigned this
    on Mar 27, 2017
  3. arielb1 commented on Mar 27, 2017

    @arielb1
    Contributor

    Looks like a double call to check_expr_has_type (

    self.check_expr_has_type(&idx, self.tcx.types.err);
    ) introduced in #24475.

  4. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Apr 4, 2017
  5. added a commit that references this issue on Apr 6, 2017
    50c1864
  6. added 3 commits that reference this issue on Feb 5, 2025
  7. added a commit that references this issue on Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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