Skip to content

Commit 7daa13d

Browse files
committed
---
yaml --- r: 56694 b: refs/heads/try c: 13801f6 h: refs/heads/master v: v3
1 parent 3dba5ad commit 7daa13d

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: d7163985b8c8daccc34cc6213fb621657f1bc50a
5+
refs/heads/try: 13801f60b26009991cd6880b6b40fae9265a8280
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,22 +1135,23 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
11351135
sugar: ast::CallSugar,
11361136
deref_args: DerefArgs) -> ty::t
11371137
{
1138-
match ty::get(method_fn_ty).sty {
1139-
ty::ty_bare_fn(ref fty) => {
1140-
check_argument_types(fcx, sp, fty.sig.inputs, callee_expr,
1141-
args, sugar, deref_args);
1142-
fty.sig.output
1143-
}
1144-
ty::ty_err => {
1145-
let err_inputs = err_args(fcx.tcx(), args.len());
1146-
check_argument_types(fcx, sp, err_inputs, callee_expr,
1147-
args, sugar, deref_args);
1148-
method_fn_ty
1149-
}
1150-
_ => {
1151-
fcx.tcx().sess.span_bug(
1152-
sp,
1153-
fmt!("Method without bare fn type"));
1138+
if ty::type_is_error(method_fn_ty) {
1139+
let err_inputs = err_args(fcx.tcx(), args.len());
1140+
check_argument_types(fcx, sp, err_inputs, callee_expr,
1141+
args, sugar, deref_args);
1142+
method_fn_ty
1143+
} else {
1144+
match ty::get(method_fn_ty).sty {
1145+
ty::ty_bare_fn(ref fty) => {
1146+
check_argument_types(fcx, sp, fty.sig.inputs, callee_expr,
1147+
args, sugar, deref_args);
1148+
fty.sig.output
1149+
}
1150+
_ => {
1151+
fcx.tcx().sess.span_bug(
1152+
sp,
1153+
fmt!("Method without bare fn type"));
1154+
}
11541155
}
11551156
}
11561157
}

0 commit comments

Comments
 (0)