@@ -2062,8 +2062,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
2062
2062
ty:: mk_fn ( fcx. ccx . tcx , proto_1, arg_tys_1, rt_1, cf, constrs) ;
2063
2063
}
2064
2064
_ {
2065
- log_err "LHS of bind expr didn't have a function type?!" ;
2066
- fail;
2065
+ fail "LHS of bind expr didn't have a function type?!" ;
2067
2066
}
2068
2067
}
2069
2068
write:: ty_only_fixup ( fcx, id, t_1) ;
@@ -2087,8 +2086,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
2087
2086
}
2088
2087
ty:: ty_native_fn ( _, _, rt) { rt_1 = rt; }
2089
2088
_ {
2090
- log_err "LHS of call expr didn't have a function type?!" ;
2091
- fail;
2089
+ fail "LHS of call expr didn't have a function type?!" ;
2092
2090
}
2093
2091
}
2094
2092
write:: ty_only_fixup ( fcx, id, rt_1) ;
@@ -2114,7 +2112,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
2114
2112
}
2115
2113
none. {
2116
2114
fcx . ccx . tcx . sess . bug ( "didn't find " + int:: str ( did. node ) +
2117
- " in type cache" ) ;
2115
+ " in type cache" ) ;
2118
2116
}
2119
2117
}
2120
2118
}
@@ -2124,8 +2122,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
2124
2122
none. {
2125
2123
// Shouldn't happen.
2126
2124
fcx. ccx . tcx . sess . span_err ( expr. span ,
2127
- "self-call in non-object \
2128
- context") ;
2125
+ "self-call in non-object context" ) ;
2129
2126
}
2130
2127
}
2131
2128
@@ -2151,7 +2148,12 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
2151
2148
ast:: expr_spawn ( _, _, f, args) {
2152
2149
bot = check_call ( fcx, expr. span , f, args, kind_spawn) ;
2153
2150
let fty = expr_ty ( fcx. ccx . tcx , f) ;
2154
- let ret_ty = ty:: ret_ty_of_fn_ty ( fcx. ccx . tcx , fty) ;
2151
+ let ret_ty = alt structure_of ( fcx, expr. span , fty) {
2152
+ ty:: ty_fn ( _, _, rt, _, _) { rt }
2153
+ ty:: ty_native_fn ( _, _, rt) { rt }
2154
+ _ { fail "LHS of spawn expr didn't have a function type?!" }
2155
+ } ;
2156
+
2155
2157
demand:: simple ( fcx, f. span , ty:: mk_nil ( fcx. ccx . tcx ) , ret_ty) ;
2156
2158
2157
2159
// make sure they aren't spawning a function with type params
0 commit comments