Skip to content

Commit

Permalink
Document base vs nested alloc interning
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 25, 2024
1 parent 432d9e5 commit 998b3b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_const_eval/src/interpret/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// Whether we encountered a bad mutable pointer.
Expand Down

0 comments on commit 998b3b7

Please sign in to comment.