Skip to content

ICE: this path really should be doomed #134162

@matthiaskrgr

Description

@matthiaskrgr
Member

auto-reduced (treereduce-rust):

fn main() {
    struct X;

    let xs = [X, X, X];
    let eq = xs == [panic!("panic evaluated"); 2];
}

original:

fn main() {
    struct X;
    //~^ HELP consider annotating `X` with `#[derive(PartialEq)]`
    let xs = [X, X, X];
    let eq = xs == [panic!("panic evaluated"); 2];
    //~^ ERROR binary operation `==` cannot be applied to type `[X; 3]`
}

Version information

rustc 1.85.0-nightly (33c245b9e 2024-12-10)
binary: rustc
commit-hash: 33c245b9e98bc91e18ea1c5033824f4c6f92766f
commit-date: 2024-12-10
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

warning: unreachable expression
 --> /tmp/icemaker_global_tempdir.NcZ6cDcOgb7d/rustc_testrunner_tmpdir_reporting.dN0NI0VTaCoG/mvce.rs:5:20
  |
5 |     let eq = xs == [panic!("panic evaluated"); 2];
  |                    ^-------------------------^^^^
  |                    ||
  |                    |any code following this expression is unreachable
  |                    unreachable expression
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: 1 warning emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: this path really should be doomed...
 --> /tmp/icemaker_global_tempdir.NcZ6cDcOgb7d/rustc_testrunner_tmpdir_reporting.dN0NI0VTaCoG/mvce.rs:5:17
  |
5 |     let eq = xs == [panic!("panic evaluated"); 2];
  |                 ^^
  |
note: delayed at compiler/rustc_hir_typeck/src/op.rs:925:28 - disabled backtrace
 --> /tmp/icemaker_global_tempdir.NcZ6cDcOgb7d/rustc_testrunner_tmpdir_reporting.dN0NI0VTaCoG/mvce.rs:5:17
  |
5 |     let eq = xs == [panic!("panic evaluated"); 2];
  |                 ^^

error: internal compiler error: expression with never type wound up being adjusted
 --> /tmp/icemaker_global_tempdir.NcZ6cDcOgb7d/rustc_testrunner_tmpdir_reporting.dN0NI0VTaCoG/mvce.rs:5:21
  |
5 |     let eq = xs == [panic!("panic evaluated"); 2];
  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: delayed at compiler/rustc_hir_typeck/src/expr.rs:76:43 - disabled backtrace
 --> /tmp/icemaker_global_tempdir.NcZ6cDcOgb7d/rustc_testrunner_tmpdir_reporting.dN0NI0VTaCoG/mvce.rs:5:21
  |
5 |     let eq = xs == [panic!("panic evaluated"); 2];
  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error: internal compiler error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_hir_typeck/src/op.rs:303:17 - disabled backtrace

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.85.0-nightly (33c245b9e 2024-12-10) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

Activity

added
C-bugCategory: This is a bug.
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.
on Dec 11, 2024
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Dec 11, 2024
jieyouxu

jieyouxu commented on Dec 11, 2024

@jieyouxu
Member

ICEs on stable too.

jieyouxu

jieyouxu commented on Dec 11, 2024

@jieyouxu
Member
********************************************************************************
Regression in nightly-2024-02-22
********************************************************************************

looking for regression commit between 2024-02-21 and 2024-02-22
fetching (via remote github) commits from max(bb594538fc6e84213a6b8d5e165442570aa48923, 2024-02-19) to 3406ada96f8e16e49e947a91db3eba0db45245fa
ending github query because we found starting sha: bb594538fc6e84213a6b8d5e165442570aa48923
get_commits_between returning commits, len: 11
  commit[0] 2024-02-20: Auto merge of #121345 - Nilstrieb:rollup-reb0xge, r=Nilstrieb
  commit[1] 2024-02-20: Auto merge of #121356 - matthiaskrgr:rollup-d80af2s, r=matthiaskrgr
  commit[2] 2024-02-21: Auto merge of #120904 - Nadrieril:match-lowering-intermediate-repr, r=matthewjasper
  commit[3] 2024-02-21: Auto merge of #121172 - Nadrieril:simplify-empty-selection, r=matthewjasper
  commit[4] 2024-02-21: Auto merge of #121380 - weihanglo:update-cargo, r=weihanglo
  commit[5] 2024-02-21: Auto merge of #120588 - alexcrichton:wasm-rmeta-object, r=wesleywiser,bjorn3
  commit[6] 2024-02-21: Auto merge of #120718 - saethlin:reasonable-fast-math, r=nnethercote
  commit[7] 2024-02-21: Auto merge of #121383 - Dylan-DPC:rollup-735p4u4, r=Dylan-DPC
  commit[8] 2024-02-21: Auto merge of #121400 - fmease:rollup-8m29g7a, r=fmease
  commit[9] 2024-02-21: Auto merge of #121321 - compiler-errors:yeet-querytyperelating, r=lcnr
  commit[10] 2024-02-21: Auto merge of #117658 - RalfJung:ptr-dangling, r=m-ou-se
ERROR: no CI builds available between bb594538fc6e84213a6b8d5e165442570aa48923 and 3406ada96f8e16e49e947a91db3eba0db45245fa within last 167 days
jieyouxu

jieyouxu commented on Dec 11, 2024

@jieyouxu
Member

I have a feeling this might be a #121208

self-assigned this
on Dec 11, 2024
jieyouxu

jieyouxu commented on Dec 11, 2024

@jieyouxu
Member
fn main() {
    struct X;
    let _ = [X] == [panic!(); 2];
}
added
S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
S-has-bisectionStatus: A bisection has been found for this issue
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Dec 11, 2024
jieyouxu

jieyouxu commented on Dec 13, 2024

@jieyouxu
Member

Ah: this is also edition sensitive. It ICEs on 2021 and 2024, but not on earlier editions.

added
S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.
on Dec 14, 2024
added a commit that references this issue on Dec 14, 2024
752f79a
added a commit that references this issue on Dec 14, 2024
0105692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @matthiaskrgr@jieyouxu@rustbot

    Issue actions

      ICE: `this path really should be doomed` · Issue #134162 · rust-lang/rust