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
Fixing this requires backwards incompatible changes to constant expressions. At a minimum, casts from pointers to integers need to be forbidden. It's possible that there are other issues.
@jdm: If it's not obvious from the code, compile and run it several times. The value of Y is determined at runtime so it's not a valid constant expression. The const type was supposed to be distinct from static by being a valid constant expression in every case but it is not.
Activity
jdm commentedon Oct 24, 2014
Can you elaborate on the problem here?
thestinger commentedon Oct 24, 2014
@jdm: If it's not obvious from the code, compile and run it several times. The value of
Y
is determined at runtime so it's not a valid constant expression. Theconst
type was supposed to be distinct fromstatic
by being a valid constant expression in every case but it is not.arielb1 commentedon Oct 24, 2014
We really shouldn't be allowing pointer -> uint conversions in constexprs.
[-]constants are not constant[/-][+]constants are not constant due to ptr->int casts[/+]Prevent pointer -> int casts in constexprs
Auto merge of rust-lang#18294 - Giga-Bowser:master, r=Veykril