We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7805c20 commit d0d9048Copy full SHA for d0d9048
src/librustc_mir/const_eval/eval_queries.rs
@@ -57,6 +57,12 @@ fn eval_body_using_ecx<'mir, 'tcx>(
57
ecx.run()?;
58
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.
66
let intern_kind = match tcx.static_mutability(cid.instance.def_id()) {
67
Some(m) => InternKind::Static(m),
68
None if cid.promoted.is_some() => InternKind::Promoted,
0 commit comments