Repository: rust
Issue: ICE: `errors selecting obligation during MIR typeck: [TrueError]`
Labels: I-ICE,T-compiler,C-bug,F-generic_const_exprs,S-bug-has-test,T-types

<!--
[31mICE[0m: Rustc ./a.rs '--crate-type=lib -ooutputfile -Zdump-mir-dir=dir' 'error: internal compiler error: errors selecting obligation during MIR typeck: [TrueError]', 'error: internal compiler error: errors selecting obligation during MIR typeck: [TrueError]'
File: /tmp/im/a.rs
-->

snippet:
````rust
#![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`

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Program output</strong></summary>
<p>

```
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

```

</p>
</details>

<!--
query stack:

-->
@rustbot label +F-generic_const_exprs