Compare two constructors with result caching (keyed by name pair).
( x: &ConstructorVal, y: &ConstructorVal, mut_ctx: &MutCtx, cache: &mut BlockCache, stt: &CompileState, )
| 2644 | let surgery_sharing = std::mem::take(&mut cache.surgery_sharing); |
| 2645 | let meta_univs: Vec<Arc<Univ>> = |
| 2646 | std::mem::take(&mut cache.meta_univs).into_iter().collect(); |
| 2647 | let univ_patches = std::mem::take(&mut cache.univ_patches); |
| 2648 | cache.arena_roots.clear(); |
| 2649 | cache.exprs.clear(); |
| 2650 | |
| 2651 | let name_addr = compile_name(&val.cnst.name, stt); |
| 2652 | let lvl_addrs: Vec<Address> = |
| 2653 | univ_params.iter().map(|n| compile_name(n, stt)).collect(); |
| 2654 | |
| 2655 | let data = |
| 2656 | Axiom { is_unsafe: val.is_unsafe, lvls: univ_params.len() as u64, typ }; |
| 2657 | |
| 2658 | let mut meta = ConstantMeta::new(ConstantMetaInfo::Axio { |
| 2659 | name: name_addr, |
| 2660 | lvls: lvl_addrs, |
| 2661 | arena, |
| 2662 | type_root, |
| 2663 | }); |
| 2664 | meta.meta_sharing = surgery_sharing; |
| 2665 | meta.meta_univs = meta_univs; |
| 2666 | meta.univ_patches = univ_patches; |
| 2667 | |
| 2668 | Ok((data, meta)) |
| 2669 | } |
| 2670 | |
| 2671 | /// Compile a Quotient. |
| 2672 | fn compile_quotient( |
no test coverage detected