+ match (self_mode, ex_self) {
+ (ty::ByRef, ast::sty_value) => {
+ debug!("by value self with type %s, storing to scratch",
+ bcx.ty_to_str(arg_datum.ty));
+ let scratch = scratch_datum(bcx, arg_datum.ty, false);
+
+ arg_datum.store_to_datum(bcx,
+ arg_expr.id,
+ INIT,
+ scratch);
+
+ // Technically, ownership of val passes to the callee.
+ // However, we must cleanup should we fail before the
+ // callee is actually invoked.
+ scratch.add_clean(bcx);
+ temp_cleanups.push(scratch.val);
+
+ val = scratch.to_ref_llval(bcx);
+ }
+ (ty::ByRef, _) => {