-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Const raw pointer to usize cast allowed in release mode, disallowed in debug mode #80875
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
While making a PoC for #67456 it was discovered that the code beblow fails to compile in debug mode (#67456 (comment)), saying that "pointer-to-integer cast needs an rfc before being allowed in constants", while in release mode, the code compiles and runs.
Here's a playground link.
Here's the error message in debug mode: