Skip to content

ICE: errors selecting obligation during MIR typeck: [TrueError] #129425

Open
@matthiaskrgr

Description

@matthiaskrgr

snippet:

#![feature(generic_const_exprs)]
fn foo<'a, T: 'a>(_: [(); std::mem::offset_of!((T,), 0)]) {}

Version information

rustc 1.82.0-nightly (5ad98b402 2024-08-22)
binary: rustc
commit-hash: 5ad98b4026d5172f27615b105658bc8bfd677be8
commit-date: 2024-08-22
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --crate-type=lib

Program output

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.tDpCHeI4R4t9/rustc_testrunner_tmpdir_reporting.Lo4fDYzUFauY/mvce.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: function `foo` is never used
 --> /tmp/icemaker_global_tempdir.tDpCHeI4R4t9/rustc_testrunner_tmpdir_reporting.Lo4fDYzUFauY/mvce.rs:2:4
  |
2 | fn foo<'a, T: 'a>(_: [(); std::mem::offset_of!((T,), 0)]) {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 2 warnings 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: Missing value for constant, but no error reported?
 --> /tmp/icemaker_global_tempdir.tDpCHeI4R4t9/rustc_testrunner_tmpdir_reporting.Lo4fDYzUFauY/mvce.rs:2:27
  |
2 | fn foo<'a, T: 'a>(_: [(); std::mem::offset_of!((T,), 0)]) {}
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: delayed at compiler/rustc_trait_selection/src/traits/const_evaluatable.rs:74:68 - disabled backtrace
 --> /tmp/icemaker_global_tempdir.tDpCHeI4R4t9/rustc_testrunner_tmpdir_reporting.Lo4fDYzUFauY/mvce.rs:2:27
  |
2 | fn foo<'a, T: 'a>(_: [(); std::mem::offset_of!((T,), 0)]) {}
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error: internal compiler error originates in the macro `std::mem::offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: errors selecting obligation during MIR typeck: [TrueError]
  |
  = note: delayed at /rustc/5ad98b4026d5172f27615b105658bc8bfd677be8/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:94:18 - 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.82.0-nightly (5ad98b402 2024-08-22) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z dump-mir-dir=dir

query stack during panic:
end of query stack

@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-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions