Skip to content

Commit f120c71

Browse files
committed
Tidy. Rename variables.
1 parent 1c3e8b0 commit f120c71

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/librustc_typeck/check/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
3737
self.write_ty(pat.id, expected);
3838
}
3939
PatKind::Lit(ref lt) => {
40-
let expr_t = self.check_expr(&lt);
40+
let ty = self.check_expr(&lt);
4141

4242
// Byte string patterns behave the same way as array patterns
4343
// They can denote both statically and dynamically sized byte arrays
44-
let mut pat_ty = expr_t;
44+
let mut pat_ty = ty;
4545
if let hir::ExprLit(ref lt) = lt.node {
4646
if let ast::LitKind::ByteStr(_) = lt.node {
4747
let expected_ty = self.structurally_resolved_type(pat.span, expected);
@@ -62,7 +62,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
6262
// relation at all but rather that there exists a LUB (so
6363
// that they can be compared). However, in practice,
6464
// constants are always scalars or strings. For scalars
65-
// subtyping is irrelevant, and for strings `expr_t` is
65+
// subtyping is irrelevant, and for strings `ty` is
6666
// type is `&'static str`, so if we say that
6767
//
6868
// &'static str <: expected

src/librustc_typeck/check/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,19 +3241,19 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
32413241
base_expr: &'gcx Option<P<hir::Expr>>) -> Ty<'tcx>
32423242
{
32433243
// Find the relevant variant
3244-
let (variant, expr_t) = if let Some(variant_ty) = self.check_struct_path(path, expr.id,
3245-
expr.span) {
3244+
let (variant, struct_ty) = if let Some(variant_ty) = self.check_struct_path(path, expr.id,
3245+
expr.span) {
32463246
variant_ty
32473247
} else {
32483248
self.check_struct_fields_on_error(fields, base_expr);
32493249
return self.tcx().types.err;
32503250
};
32513251

3252-
self.check_expr_struct_fields(expr_t, path.span, variant, fields,
3252+
self.check_expr_struct_fields(struct_ty, path.span, variant, fields,
32533253
base_expr.is_none());
32543254
if let &Some(ref base_expr) = base_expr {
3255-
self.check_expr_has_type(base_expr, expr_t);
3256-
match expr_t.sty {
3255+
self.check_expr_has_type(base_expr, struct_ty);
3256+
match struct_ty.sty {
32573257
ty::TyStruct(adt, substs) => {
32583258
self.tables.borrow_mut().fru_field_types.insert(
32593259
expr.id,
@@ -3270,8 +3270,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
32703270
}
32713271
}
32723272
}
3273-
self.require_type_is_sized(expr_t, expr.span, traits::StructInitializerSized);
3274-
expr_t
3273+
self.require_type_is_sized(struct_ty, expr.span, traits::StructInitializerSized);
3274+
struct_ty
32753275
}
32763276

32773277

@@ -3881,15 +3881,15 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
38813881
hir::StmtExpr(ref expr, id) => {
38823882
node_id = id;
38833883
// Check with expected type of ()
3884-
let expr_t = self.check_expr_has_type(&expr, self.tcx.mk_nil());
3885-
saw_bot = saw_bot || self.type_var_diverges(expr_t);
3886-
saw_err = saw_err || expr_t.references_error();
3884+
let ty = self.check_expr_has_type(&expr, self.tcx.mk_nil());
3885+
saw_bot = saw_bot || self.type_var_diverges(ty);
3886+
saw_err = saw_err || ty.references_error();
38873887
}
38883888
hir::StmtSemi(ref expr, id) => {
38893889
node_id = id;
3890-
let expr_t = self.check_expr(&expr);
3891-
saw_bot |= self.type_var_diverges(expr_t);
3892-
saw_err |= expr_t.references_error();
3890+
let ty = self.check_expr(&expr);
3891+
saw_bot |= self.type_var_diverges(ty);
3892+
saw_err |= ty.references_error();
38933893
}
38943894
}
38953895
if saw_bot {

src/librustc_typeck/check/op.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
3232
self.check_overloaded_binop(expr, lhs_expr, lhs_ty, rhs_expr, op, IsAssign::Yes);
3333
let rhs_ty = self.resolve_type_vars_with_obligations(rhs_ty);
3434

35-
let ty = if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var() && is_builtin_binop(lhs_ty, rhs_ty, op) {
35+
let ty = if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var()
36+
&& is_builtin_binop(lhs_ty, rhs_ty, op) {
3637
self.enforce_builtin_binop_types(lhs_expr, lhs_ty, rhs_expr, rhs_ty, op);
3738
self.tcx.mk_nil()
3839
} else {

0 commit comments

Comments
 (0)