Skip to content

Commit 13f35de

Browse files
committed
Elaborate on a comment
1 parent 9e3fbcf commit 13f35de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_mir/const_eval.rs

+2
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ fn validate_and_turn_into_const<'tcx>(
540540
)?;
541541
}
542542
// 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.
543545
let def_id = cid.instance.def.def_id();
544546
if tcx.is_static(def_id) || cid.promoted.is_some() {
545547
let ptr = mplace.ptr.to_ptr()?;

0 commit comments

Comments
 (0)