compiler/rustc_error_codes/src/error_codes/E0013.md MARKDOWN 21 lines View on github.com → Search inside
1#### Note: this error code is no longer emitted by the compiler23Static and const variables can refer to other const variables. But a const4variable cannot refer to a static variable.56Erroneous code example:78```9static X: i32 = 42;10const Y: i32 = X;11```1213In this example, `Y` cannot refer to `X`. To fix this, the value can be14extracted as a const and then used:1516```17const A: i32 = 42;18static X: i32 = A;19const Y: i32 = A;20```

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.