/// Replace the self type (&Self or Box<Self>) with an opaque pointer.
Replace the self type (&Self or Box) with an opaque pointer.
Replace the self type ( &Self or Box ) with an opaque pointer .
fn opaque_method_ty<'tcx>(tcx: &ty::ctxt<'tcx>, method_ty: &ty::BareFnTy<'tcx>)
                          -> &'tcx ty::BareFnTy<'tcx> {
    let mut inputs = method_ty.sig.0.inputs.clone();
    inputs[0] = tcx.mk_mut_ptr(tcx.mk_mach_int(hir::TyI8));
    tcx.mk_bare_fn(ty::BareFnTy {
        unsafety: method_ty.unsafety,
        abi: method_ty.abi,
        sig: ty::Binder(ty::FnSig {
            inputs: inputs,
            output: method_ty.sig.0.output,
            variadic: method_ty.sig.0.variadic,
        }),
    })
}
fn opaque_method_ty < ' tcx > ( tcx : & ty :: ctxt < ' tcx > , method_ty : & ty :: BareFnTy < ' tcx > ) -> & ' tcx ty :: BareFnTy < ' tcx > { let mut inputs = method_ty . sig . 0 . inputs . clone ( ) ; inputs [ 0 ] = tcx . mk_mut_ptr ( tcx . mk_mach_int ( hir :: TyI8 ) ) ; tcx . mk_bare_fn ( ty :: BareFnTy { unsafety : method_ty . unsafety , abi : method_ty . abi , sig : ty :: Binder ( ty :: FnSig { inputs : inputs , output : method_ty . sig . 0 . output , variadic : method_ty . sig . 0 . variadic , } ) , } ) }
Replace the self type (&Self or Box<Self>) with an opaque pointer.
Replace the self type ( &Self or Box<Self > ) with an opaque pointer .
tcx
&ty::ctxt<'tcx>
method_ty
&ty::BareFnTy<'tcx>