diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-06-11 16:17:17 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-06-19 09:52:35 +0200 |
| commit | 13f35de19d586ae125ec2c99b51d3d4a9321ca3b (patch) | |
| tree | 19e7cfeef4600a700b057ab6adead3643ae234f3 | |
| parent | 9e3fbcfd571d3ed4c0729a1ae822377bc075fcd6 (diff) | |
Elaborate on a comment
| -rw-r--r-- | src/librustc_mir/const_eval.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index ef8d0bb1e27..d6c0744b4e8 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -540,6 +540,8 @@ fn validate_and_turn_into_const<'tcx>( )?; } // Now that we validated, turn this into a proper constant. + // Statics/promoteds are always `ByRef`, for the rest `op_to_const` decides + // whether they become immediates. let def_id = cid.instance.def.def_id(); if tcx.is_static(def_id) || cid.promoted.is_some() { let ptr = mplace.ptr.to_ptr()?; |
