about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-03-25 08:46:58 +0100
committerRalf Jung <post@ralfj.de>2020-03-25 08:46:58 +0100
commit4920a3371f5c02e61d3a0f5722ff7034a99938ff (patch)
tree3d72eee73f80f40965a61590bbc61268c4043449
parent02046a5d402c789c006d0da7662f800fe3c45faf (diff)
downloadrust-4920a3371f5c02e61d3a0f5722ff7034a99938ff.tar.gz
rust-4920a3371f5c02e61d3a0f5722ff7034a99938ff.zip
better explain GLOBAL_KIND choice
-rw-r--r--src/librustc_mir/const_eval/machine.rs2
-rw-r--r--src/librustc_mir/transform/const_prop.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/const_eval/machine.rs b/src/librustc_mir/const_eval/machine.rs
index 8f4501cc3fb..3f657089251 100644
--- a/src/librustc_mir/const_eval/machine.rs
+++ b/src/librustc_mir/const_eval/machine.rs
@@ -178,7 +178,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter {
 
     type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
 
-    const GLOBAL_KIND: Option<!> = None; // no copying of globals allowed
+    const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
 
     // We do not check for alignment to avoid having to carry an `Align`
     // in `ConstValue::ByRef`.
diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs
index cbb79637076..232d33a3531 100644
--- a/src/librustc_mir/transform/const_prop.rs
+++ b/src/librustc_mir/transform/const_prop.rs
@@ -172,7 +172,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine {
 
     type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
 
-    const GLOBAL_KIND: Option<!> = None;
+    const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
 
     const CHECK_ALIGN: bool = false;