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
And I thought: "this should compile fine. If that yields an error, it's a bug."
So I checked. It does not yield the error.
Here is the text in question:
The value of static and const variables must be known at compile time. You can't cast a pointer as an integer because we can't know what value the address will take.
However, pointers to other constants' addresses are allowed in constants, example:
const X: u32 = 50;
const Y: *const u32 = &X;
Therefore, casting one of these non-constant pointers to an integer results in a non-constant integer which lead to this error. Example: