You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on rebasing #20795 I discovered that the new run-fail tests it adds were failing to panic, because the arithmetic in question was being handled by the constant evaluation, and the overflow was thus happening at compile time rather than run time.
An example of such an expression:
fnmain(){let x = 200u8 + 200u8 + 200u8;}
(Thank goodness it didn't cause my rustc to panic! That would have been a bit frustrating.)
That is, the program above should fail to compile, and it should not cause an ICE; it should signal a proper error message saying that the arithmetic expression overflowed (because 200+200+200 == 600 > 255 == u8::MAX).