E3122 Safety Errors

Safety

cannot take the address of const '%s'; addr() on an immutable variable would allow mutation through the pointer

When this occurs

This error is triggered when: cannot take the address of const '%s'; addr() on an immutable variable would allow mutation through the pointer

Example error message

error[E3122]: cannot take the address of const '%s'; addr() on an immutable variable would allow mutation through the pointer

How to fix

Review the error message and check your code at the indicated location. The message describes what went wrong — fix the underlying issue it identifies.

Related errors

No related errors.