1
Fork 0

resolve some merge failures

This commit is contained in:
Niko Matsakis 2012-02-05 09:56:10 -08:00
parent 77b06d24cd
commit 7f12358656
3 changed files with 5 additions and 9 deletions

View file

@ -243,11 +243,12 @@ fn check_bind(cx: @ctx, f: @expr, args: [option<@expr>]) {
for arg in args { for arg in args {
alt arg { alt arg {
some(expr) { some(expr) {
alt (alt arg_ts[i].mode { let o_msg = alt ty::resolved_mode(cx.tcx, arg_ts[i].mode) {
by_mut_ref { some("by mutable reference") } by_mut_ref { some("by mutable reference") }
by_move { some("by move") } by_move { some("by move") }
_ { none } _ { none }
}) { };
alt o_msg {
some(name) { some(name) {
cx.tcx.sess.span_err( cx.tcx.sess.span_err(
expr.span, "can not bind an argument passed " + name); expr.span, "can not bind an argument passed " + name);

View file

@ -4422,8 +4422,7 @@ fn copy_args_to_allocas(fcx: @fn_ctxt, bcx: @block_ctxt, args: [ast::arg],
let epic_fail = fn@() -> ! { let epic_fail = fn@() -> ! {
tcx.sess.bug("Someone forgot\ tcx.sess.bug("Someone forgot\
to document an invariant in copy_args_to_allocas!"); to document an invariant in copy_args_to_allocas!");
} };
let epic_fail = bind epic_fail_(bcx);
for arg in arg_tys { for arg in arg_tys {
let id = args[arg_n].id; let id = args[arg_n].id;
let argval = alt fcx.llargs.get(id) { local_mem(v) { v } let argval = alt fcx.llargs.get(id) { local_mem(v) { v }

View file

@ -2045,11 +2045,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
// Take the prototype from the expected type, but default to block: // Take the prototype from the expected type, but default to block:
let proto = alt ty::struct(tcx, expected) { let proto = alt ty::struct(tcx, expected) {
ty::ty_fn({proto, _}) { proto } ty::ty_fn({proto, _}) { proto }
_ { _ { ast::proto_box }
tcx.sess.span_warn(expr.span, "unable to infer kind of closure, \
defaulting to block");
ast::proto_block
}
}; };
#debug("checking expr_fn_block %s expected=%s", #debug("checking expr_fn_block %s expected=%s",
expr_to_str(expr), expr_to_str(expr),