Closed as not planned
Description
Constants cannot refer to statics.
Yet the following works fine: playground
pub const A: i64 = 0;
pub static B: i64 = A + 1;
pub const C: i64 = B + 1;
This may have changed as a result of recent changes related to Rust-for-Linux such as the stabilization of const_refs_to_static
: rust-lang/rust#119618
Depending on what the new rule is, there may also be a SemVer hazard here. For example, if the new rule is "consts may only refer to statics without interior mutability" then newly adding interior mutability to a pub static would appear to be a major breaking change. If so, we should consider updating the cargo SemVer reference as well.
Metadata
Metadata
Assignees
Labels
No labels