MCPcopy Create free account
hub / github.com/argumentcomputer/ix / compare_external_refs

Function compare_external_refs

crates/compile/src/compile.rs:2442–2459  ·  view source on GitHub ↗

Compare two non-mutual references by compiled address. Canonical sorting must not fall back to name order here: unresolved names would reintroduce namespace/source-order information into content hashes.

(
  x: &Name,
  y: &Name,
  stt: &CompileState,
  caller: &'static str,
)

Source from the content-addressed store, hash-verified

2440 // §10.6) drain on the same boundary for the same reason.
2441 let arena = std::mem::take(&mut cache.arena);
2442 let surgery_sharing = std::mem::take(&mut cache.surgery_sharing);
2443 let meta_univs: Vec<Arc<Univ>> =
2444 std::mem::take(&mut cache.meta_univs).into_iter().collect();
2445 let univ_patches = std::mem::take(&mut cache.univ_patches);
2446 cache.arena_roots.clear();
2447 cache.exprs.clear();
2448
2449 let name_addr = compile_name(&rec.cnst.name, stt);
2450 let lvl_addrs: Vec<Address> =
2451 univ_params.iter().map(|n| compile_name(n, stt)).collect();
2452
2453 let data = Recursor {
2454 k: rec.k,
2455 is_unsafe: rec.is_unsafe,
2456 lvls: univ_params.len() as u64,
2457 params: nat_to_u64(&rec.num_params, "num_params too large")?,
2458 indices: nat_to_u64(&rec.num_indices, "num_indices too large")?,
2459 motives: nat_to_u64(&rec.num_motives, "num_motives too large")?,
2460 minors: nat_to_u64(&rec.num_minors, "num_minors too large")?,
2461 typ,
2462 rules,

Callers 1

compare_exprFunction · 0.85

Calls 2

resolve_addrMethod · 0.80
prettyMethod · 0.80

Tested by

no test coverage detected