pub fn box_into_mut_ref_ret(self, ptrs: &BTreeMap<TempIndex, &Pointer>) -> TypedValue {
        fn follow_return_pointers_recursive(
            cur: &Pointer,
            ptrs: &BTreeMap<TempIndex, &Pointer>,
            trace: &mut Vec<Pointer>,
        ) {
            match cur {
                Pointer::ArgRef(_, _) => trace.push(cur.clone()),
                Pointer::RefField(idx, _) | Pointer::RefElement(idx, _) => {
                    trace.push(cur.clone());
                    follow_return_pointers_recursive(ptrs.get(idx).unwrap(), ptrs, trace);
                }
                Pointer::None | Pointer::Local(_) | Pointer::Global(_) | Pointer::RetRef(_) => {
                    unreachable!()
                }
            }
        }

        let (ty, val, ptr) = self.decompose();
        if cfg!(debug_assertions) {
            assert!(ty.is_ref(Some(true)));
        }

        let mut trace = vec![];
        follow_return_pointers_recursive(&ptr, ptrs, &mut trace);
        let boxed_ptr = Pointer::RetRef(trace);
        TypedValue {
            ty,
            val,
            ptr: boxed_ptr,
        }
    }
/// Wrap the pointer in the mutable reference to mark that this ref is passed out as a return
Wrap the pointer in the mutable reference to mark that this ref is passed out as a return
Wrap the pointer in the mutable reference to mark that this ref is passed out as a return
pub fn box_into_mut_ref_ret(self, ptrs: &BTreeMap<TempIndex, &Pointer>) -> TypedValue {
        fn follow_return_pointers_recursive(
            cur: &Pointer,
            ptrs: &BTreeMap<TempIndex, &Pointer>,
            trace: &mut Vec<Pointer>,
        ) {
            match cur {
                Pointer::ArgRef(_, _) => trace.push(cur.clone()),
                Pointer::RefField(idx, _) | Pointer::RefElement(idx, _) => {
                    trace.push(cur.clone());
                    follow_return_pointers_recursive(ptrs.get(idx).unwrap(), ptrs, trace);
                }
                Pointer::None | Pointer::Local(_) | Pointer::Global(_) | Pointer::RetRef(_) => {
                    unreachable!()
                }
            }
        }
        let (ty, val, ptr) = self.decompose();
        if cfg!(debug_assertions) {
            assert!(ty.is_ref(Some(true)));
        }
        let mut trace = vec![];
        follow_return_pointers_recursive(&ptr, ptrs, &mut trace);
        let boxed_ptr = Pointer::RetRef(trace);
        TypedValue {
            ty,
            val,
            ptr: boxed_ptr,
        }
    }
pub fn box_into_mut_ref_ret ( self , ptrs : & BTreeMap < TempIndex , & Pointer > ) -> TypedValue { fn follow_return_pointers_recursive ( cur : & Pointer , ptrs : & BTreeMap < TempIndex , & Pointer > , trace : & mut Vec < Pointer > , ) { match cur { Pointer :: ArgRef ( _ , _ ) => trace . push ( cur . clone ( ) ) , Pointer :: RefField ( idx , _ ) | Pointer :: RefElement ( idx , _ ) => { trace . push ( cur . clone ( ) ) ; follow_return_pointers_recursive ( ptrs . get ( idx ) . unwrap ( ) , ptrs , trace ) ; } Pointer :: None | Pointer :: Local ( _ ) | Pointer :: Global ( _ ) | Pointer :: RetRef ( _ ) => { unreachable ! ( ) } } } let ( ty , val , ptr ) = self . decompose ( ) ; if cfg ! ( debug_assertions ) { assert ! ( ty is_ref ( Some ( true ) ) ) ; } let mut trace = vec ! [ ] ; follow_return_pointers_recursive ( & ptr , ptrs , & mut trace ) ; let boxed_ptr = Pointer :: RetRef ( trace ) ; TypedValue { ty , val , ptr : boxed_ptr , } }
Wrap the pointer in the mutable reference to mark that this ref is passed out as a return
Wrap the pointer in the mutable reference to mark that this ref is passed out as a return
self
ptrs
&BTreeMap<TempIndex, &Pointer>