diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-01-25 10:38:17 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-01-29 08:59:51 +0000 |
| commit | 5d46b982c539ef3a227bd5557ec8a1648dfc5a5c (patch) | |
| tree | 0714361bac6da7ea42db6a2ae862483594df11b1 /compiler/rustc_const_eval | |
| parent | a57a00ebf69722de2944d37de10946cf3aa6fe15 (diff) | |
| download | rust-5d46b982c539ef3a227bd5557ec8a1648dfc5a5c.tar.gz rust-5d46b982c539ef3a227bd5557ec8a1648dfc5a5c.zip | |
Document base vs nested alloc interning
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/intern.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 7621d038855..c3a53f90e60 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -125,6 +125,9 @@ pub fn intern_const_alloc_recursive< // Intern the base allocation, and initialize todo list for recursive interning. let base_alloc_id = ret.ptr().provenance.unwrap().alloc_id(); + // First we intern the base allocation, as it requires a different mutability. + // This gives us the initial set of nested allocations, which will then all be processed + // recursively in the loop below. let mut todo: Vec<_> = intern_shallow(ecx, base_alloc_id, base_mutability).unwrap().map(|prov| prov).collect(); // We need to distinguish "has just been interned" from "was already in `tcx`", |
