Skip to content

ICE: entered unreachable code: TypingMode x Reveal mismatch: UserFacing PostAnalysis #133271

Closed
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

#![feature(generic_const_exprs)]

struct Foo;
impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo
where
    [(); 1 + 0]: Sized,
{
    fn unimplemented(self, _: &Foo) -> Self::Output {
        loop {}
    }
}

original:

//@ revisions: rpass
#![feature(generic_const_exprs)]
#![call_test(incomplete_features)]

struct Foo;
impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo
where
    [(); 1 + 0]: Sized,
{
    type Output = ();
    fn unimplemented(self, _: &Foo) -> Self::Output {
        loop {}
    }
}

fn writes_to_path() {
    Foo([])
}

Version information

rustc 1.84.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.84.0-dev
LLVM version: 19.1.3

Possibly related line of code:

param_env_for_debug_assertion: ty::ParamEnv<'tcx>,
) -> TypingMode<'tcx> {
if cfg!(debug_assertions) {
match (param_env_for_debug_assertion.reveal(), self.typing_mode) {
(Reveal::All, TypingMode::PostAnalysis)
| (Reveal::UserFacing, TypingMode::Coherence | TypingMode::Analysis { .. }) => {}
(r, t) => unreachable!("TypingMode x Reveal mismatch: {r:?} {t:?}"),
}
}
self.typing_mode
}
#[inline(always)]

@rustbot label +F-generic_const_exprs

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-generic_const_exprs`#![feature(generic_const_exprs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-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.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions