-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*&X allows referring to the static X by value as if X were a const #26121
Labels
A-type-system
Area: Type system
Comments
compiling the following: static A: i32 = 42;
static B: i32 = *&A; will (in my modified rustc to show CheckCrateVisitor::{consume, borrow}) yield the following relevant debug messages:
|
produces |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found by @eddyb at #25570 (comment).
aborts the compiler:
prints
0
on the terminal without any warnings or errorsIt doesn't really cause any weird behavior if it's a global static, it just acts as if the referred to static were a const: PlayPen
The text was updated successfully, but these errors were encountered: