@@ -14,7 +14,7 @@ use middle::pat_util::{PatIdMap, pat_id_map, pat_is_binding, pat_is_const};
14
14
use middle:: pat_util:: { pat_is_variant_or_struct} ;
15
15
use middle:: ty;
16
16
use middle:: typeck:: check:: demand;
17
- use middle:: typeck:: check:: { check_block, check_expr_with , fn_ctxt} ;
17
+ use middle:: typeck:: check:: { check_block, check_expr_has_type , fn_ctxt} ;
18
18
use middle:: typeck:: check:: { instantiate_path, lookup_def, lookup_local} ;
19
19
use middle:: typeck:: check:: { structure_of, valid_range_bounds} ;
20
20
use middle:: typeck:: require_same_types;
@@ -35,7 +35,7 @@ fn check_match(fcx: @fn_ctxt,
35
35
let mut bot;
36
36
37
37
let pattern_ty = fcx. infcx ( ) . next_ty_var ( ) ;
38
- bot = check_expr_with ( fcx, discrim, pattern_ty) ;
38
+ bot = check_expr_has_type ( fcx, discrim, pattern_ty) ;
39
39
40
40
// Typecheck the patterns first, so that we get types for all the
41
41
// bindings.
@@ -55,7 +55,7 @@ fn check_match(fcx: @fn_ctxt,
55
55
let mut arm_non_bot = false ;
56
56
for arms. each |arm| {
57
57
match arm. guard {
58
- Some ( e) => { check_expr_with ( fcx, e, ty:: mk_bool ( tcx) ) ; } ,
58
+ Some ( e) => { check_expr_has_type ( fcx, e, ty:: mk_bool ( tcx) ) ; } ,
59
59
None => ( )
60
60
}
61
61
if !check_block ( fcx, arm. body ) { arm_non_bot = true ; }
@@ -334,12 +334,12 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
334
334
fcx.write_ty(pat.id, expected);
335
335
}
336
336
ast::pat_lit(lt) => {
337
- check_expr_with (fcx, lt, expected);
337
+ check_expr_has_type (fcx, lt, expected);
338
338
fcx.write_ty(pat.id, fcx.expr_ty(lt));
339
339
}
340
340
ast::pat_range(begin, end) => {
341
- check_expr_with (fcx, begin, expected);
342
- check_expr_with (fcx, end, expected);
341
+ check_expr_has_type (fcx, begin, expected);
342
+ check_expr_has_type (fcx, end, expected);
343
343
let b_ty =
344
344
fcx.infcx().resolve_type_vars_if_possible(fcx.expr_ty(begin));
345
345
let e_ty =
0 commit comments