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