]> git.lizzy.rs Git - rust.git/commitdiff
better explain GLOBAL_KIND choice
authorRalf Jung <post@ralfj.de>
Wed, 25 Mar 2020 07:46:58 +0000 (08:46 +0100)
committerRalf Jung <post@ralfj.de>
Wed, 25 Mar 2020 07:46:58 +0000 (08:46 +0100)
src/librustc_mir/const_eval/machine.rs
src/librustc_mir/transform/const_prop.rs

index 8f4501cc3fb69ace1fd213244a418c1bab5d4275..3f657089251e405af222a44719e35599f13daa88 100644 (file)
@@ -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`.
index cbb79637076bc3b31bcfcf3f4daef64a2eb86fc3..232d33a35313e711d8f410ac817ea951790121cc 100644 (file)
@@ -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;