compiler/rustc_error_codes/src/error_codes/E0014.md MARKDOWN 21 lines View on github.com → Search inside
1#### Note: this error code is no longer emitted by the compiler.23Constants can only be initialized by a constant value or, in a future4version of Rust, a call to a const function. This error indicates the use5of a path (like a::b, or x) denoting something other than one of these6allowed items.78Erroneous code example:910```11const FOO: i32 = { let x = 0; x }; // 'x' isn't a constant nor a function!12```1314To avoid it, you have to replace the non-constant value:1516```17const FOO: i32 = { const X : i32 = 0; X };18// or even:19const FOO2: i32 = { 0 }; // but brackets are useless here20```

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.