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>(
5959 ecx. run ( ) ?;
6060
6161 // 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+ }
7269 } ;
7370 intern_const_alloc_recursive (
7471 ecx,
You can’t perform that action at this time.
0 commit comments