We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e3fbcf commit 13f35deCopy full SHA for 13f35de
src/librustc_mir/const_eval.rs
@@ -540,6 +540,8 @@ fn validate_and_turn_into_const<'tcx>(
540
)?;
541
}
542
// Now that we validated, turn this into a proper constant.
543
+ // Statics/promoteds are always `ByRef`, for the rest `op_to_const` decides
544
+ // whether they become immediates.
545
let def_id = cid.instance.def.def_id();
546
if tcx.is_static(def_id) || cid.promoted.is_some() {
547
let ptr = mplace.ptr.to_ptr()?;
0 commit comments