-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for &mut T in const contexts (const_mut_refs) #57349
Copy link
Copy link
Closed
rust-lang/reference
#1590Closed
Copy link
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_mut_refs`#![feature(const_mut_refs)]``#![feature(const_mut_refs)]`T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_mut_refs`#![feature(const_mut_refs)]``#![feature(const_mut_refs)]`T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
The
const_mut_refsfeature gate allows the following in const context:&mutarguments&mutandaddr_of_mut!expressions)*expressions)Remaining work
static mut FOO: &'static mut i32 = &mut 42;is problematic, because LLVM currently duplicates the inner mutable reference when you dostatic mut BAR: &'static mut i32 = FOO;. It would probably suffice to give all nested allocations in a static names relative to their original static item. Named allocations are neither deduplicated nor duplicated.constrelies on types more than it should, given thattransmuteis available in consts. Fixed in const-eval interning: get rid of type-driven traversal #119044.&mut(and*mut) as well as&Cell(and*const Cell) in const #129195Open questions
index out of bounds: the len is 5 but the index is 5#122399, ICE: hir: index out of bounds: the len is 5 but the index is 5 rustc_codegen_gcc#473