Skip to content

Commit f7cb7b0

Browse files
committed
typeck: Minor cleanup
1 parent 7c2e981 commit f7cb7b0

File tree

1 file changed

+16
-16
lines changed
  • src/rustc/middle/typeck/check

1 file changed

+16
-16
lines changed

src/rustc/middle/typeck/check/alt.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,37 +128,37 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
128128
fcx.write_ty(pat.id, expected);
129129
}
130130
ast::pat_lit(lt) {
131-
check_expr_with(pcx.fcx, lt, expected);
131+
check_expr_with(fcx, lt, expected);
132132
fcx.write_ty(pat.id, fcx.expr_ty(lt));
133133
}
134134
ast::pat_range(begin, end) {
135-
check_expr_with(pcx.fcx, begin, expected);
136-
check_expr_with(pcx.fcx, end, expected);
137-
let b_ty = resolve_type_vars_if_possible(pcx.fcx,
135+
check_expr_with(fcx, begin, expected);
136+
check_expr_with(fcx, end, expected);
137+
let b_ty = resolve_type_vars_if_possible(fcx,
138138
fcx.expr_ty(begin));
139139
if !require_same_types(
140140
tcx, pat.span, b_ty,
141141
resolve_type_vars_if_possible(
142-
pcx.fcx, fcx.expr_ty(end)),
142+
fcx, fcx.expr_ty(end)),
143143
{|| "mismatched types in range" }) {
144144
// no-op
145145
} else if !ty::type_is_numeric(b_ty) {
146146
tcx.sess.span_err(pat.span, "non-numeric type used in range");
147-
} else if !valid_range_bounds(pcx.fcx.ccx, begin, end) {
147+
} else if !valid_range_bounds(fcx.ccx, begin, end) {
148148
tcx.sess.span_err(begin.span, "lower range bound must be less \
149149
than upper");
150150
}
151151
fcx.write_ty(pat.id, b_ty);
152152
}
153153
ast::pat_ident(name, sub) if !pat_is_variant(tcx.def_map, pat) {
154-
let vid = lookup_local(pcx.fcx, pat.span, pat.id);
154+
let vid = lookup_local(fcx, pat.span, pat.id);
155155
let mut typ = ty::mk_var(tcx, vid);
156-
demand::suptype(pcx.fcx, pat.span, expected, typ);
156+
demand::suptype(fcx, pat.span, expected, typ);
157157
let canon_id = pcx.map.get(ast_util::path_to_ident(name));
158158
if canon_id != pat.id {
159-
let tv_id = lookup_local(pcx.fcx, pat.span, canon_id);
159+
let tv_id = lookup_local(fcx, pat.span, canon_id);
160160
let ct = ty::mk_var(tcx, tv_id);
161-
demand::suptype(pcx.fcx, pat.span, ct, typ);
161+
demand::suptype(fcx, pat.span, ct, typ);
162162
}
163163
fcx.write_ty(pat.id, typ);
164164
alt sub {
@@ -173,7 +173,7 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
173173
check_pat_variant(pcx, pat, path, subpats, expected);
174174
}
175175
ast::pat_rec(fields, etc) {
176-
let ex_fields = alt structure_of(pcx.fcx, pat.span, expected) {
176+
let ex_fields = alt structure_of(fcx, pat.span, expected) {
177177
ty::ty_rec(fields) { fields }
178178
_ {
179179
tcx.sess.span_fatal
@@ -210,7 +210,7 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
210210
fcx.write_ty(pat.id, expected);
211211
}
212212
ast::pat_tup(elts) {
213-
let ex_elts = alt structure_of(pcx.fcx, pat.span, expected) {
213+
let ex_elts = alt structure_of(fcx, pat.span, expected) {
214214
ty::ty_tup(elts) { elts }
215215
_ {
216216
tcx.sess.span_fatal
@@ -235,7 +235,7 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
235235
fcx.write_ty(pat.id, expected);
236236
}
237237
ast::pat_box(inner) {
238-
alt structure_of(pcx.fcx, pat.span, expected) {
238+
alt structure_of(fcx, pat.span, expected) {
239239
ty::ty_box(e_inner) {
240240
check_pat(pcx, inner, e_inner.ty);
241241
fcx.write_ty(pat.id, expected);
@@ -244,13 +244,13 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
244244
tcx.sess.span_fatal(
245245
pat.span,
246246
"mismatched types: expected `" +
247-
pcx.fcx.ty_to_str(expected) +
247+
fcx.ty_to_str(expected) +
248248
"` found box");
249249
}
250250
}
251251
}
252252
ast::pat_uniq(inner) {
253-
alt structure_of(pcx.fcx, pat.span, expected) {
253+
alt structure_of(fcx, pat.span, expected) {
254254
ty::ty_uniq(e_inner) {
255255
check_pat(pcx, inner, e_inner.ty);
256256
fcx.write_ty(pat.id, expected);
@@ -259,7 +259,7 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
259259
tcx.sess.span_fatal(
260260
pat.span,
261261
"mismatched types: expected `" +
262-
pcx.fcx.ty_to_str(expected) +
262+
fcx.ty_to_str(expected) +
263263
"` found uniq");
264264
}
265265
}

0 commit comments

Comments
 (0)