This is a known bug in the compiler which only affects rustc 1.45. rustc 1.44 is not affected and the issue has already been fixed on Beta which means it will be fixed on rustc 1.46.
An issue has been opened to track it.
While this issue seem critical, it is very unlikely to be found in real code according to oli-obk, one of the main contributor to rustc, and in particular on const
expressions:
The bug is almost impossible to trigger on real world code. You need all values that are going into the bug to be constant values and there can’t be any control flow or function calls in between.
Version 1.45.1 has been released and contains a backport of the fix from beta, among other things. Later version 1.45.2 was released with more (unrelated) fixes.