"internal compiler error: cannot relate constants" from const generic expression using generic associated types #107920
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I was writing some code that uses traits with generic associated types and hit an ICE when adding const generic bounds to a function.
Code
Playground link
I couldn't easily minimize it much more than this, unfortunately. The bound in question is
Equal<{ core::mem::size_of::<T>() }, { core::mem::size_of::<U>() }>: True
, and goes away if you remove theTO
andFROM
functions and definitions in the Tokenize trait. The ICE goes away if you change the left-hand tocore::mem::size_of::<T>() as usize
instead.Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: