Skip to content

internal compiler error: Switch on discriminant of non-ADT #5238

@russcam

Description

@russcam

Hi! I'm using the github clippy action, and have started to see the following internal compiler error when clippy runs

    Checking rustc-ap-rustc_parse v642.0.0
error: internal compiler error: src\librustc_mir\dataflow\generic\engine.rs:315: Switch on discriminant of non-ADT

thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:881:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.0.212 (fc5d0cc5 2020-02-24)

error: aborting due to previous error

This can be seen in https://github.com/elastic/elasticsearch-rs/commit/d0efcc8e174682da9d2cf215f1dacdedaf802b0b/checks?check_suite_id=487235109.

I can reproduce it locally with latest nightly.

Activity

added
C-bugCategory: Clippy is not doing the correct thing
I-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
on Feb 28, 2020
JohnTitor

JohnTitor commented on Feb 28, 2020

@JohnTitor
Member

Thanks for the report! We also saw that in our CI: https://github.com/rust-lang/rust-clippy/runs/473320782
I've investigated and prepared a fix.

matthiaskrgr

matthiaskrgr commented on Feb 28, 2020

@matthiaskrgr
Member

reduced crash sample:

#![feature(generators, generator_trait)]

fn main() {
    let _ = || { yield; };
}
repi

repi commented on Feb 28, 2020

@repi

We also ran into this with the same clippy version and latest nightly

added a commit that references this issue on Feb 28, 2020

10 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @russcam@matthiaskrgr@repi@o0Ignition0o@flip1995

        Issue actions

          internal compiler error: Switch on discriminant of non-ADT · Issue #5238 · rust-lang/rust-clippy