Closed
Description
RFC: https://github.com/rust-lang/rfcs/blob/master/text/1414-rvalue_static_promotion.md
RFC PR: rust-lang/rfcs#1414
Promote constexpr rvalues to values in static memory instead of stack slots, and expose those in the language by being able to directly create 'static
references to them. This would allow code like let x: &'static u32 = &42
to work.
Related issues (closed in favor of this one):
- Lifetime of fn() converted to &Fn() isn't long enough #28546 -- contains an example test case!
Metadata
Assignees
Labels
Blocker: Approved by a merged RFC but not yet implemented.Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the language team, which will review and decide on the PR/issue.In the final comment period and will be merged soon unless new substantive objections are raised.