File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/librustc_mir/const_eval Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ fn eval_body_using_ecx<'mir, 'tcx>(
57
57
ecx. run ( ) ?;
58
58
59
59
// Intern the result
60
+ // FIXME: since the DefId of a promoted is the DefId of its owner, this
61
+ // means that promoteds in statics are actually interned like statics!
62
+ // However, this is also currently crucial because we promote mutable
63
+ // non-empty slices in statics to extend their lifetime, and this
64
+ // ensures that they are put into a mutable allocation.
65
+ // For other kinds of promoteds in statics (like array initializers), this is rather silly.
60
66
let intern_kind = match tcx. static_mutability ( cid. instance . def_id ( ) ) {
61
67
Some ( m) => InternKind :: Static ( m) ,
62
68
None if cid. promoted . is_some ( ) => InternKind :: Promoted ,
You can’t perform that action at this time.
0 commit comments