@@ -1132,7 +1132,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1132
1132
// and so forth. - Niko
1133
1133
fcx. write_nil ( expr. id ) ;
1134
1134
}
1135
- ast:: expr_unary ( unop, oper ) {
1135
+ ast:: expr_unary ( unop, oprnd ) {
1136
1136
let exp_inner = unpack_expected ( fcx, expected) { |sty|
1137
1137
alt unop {
1138
1138
ast : : box ( _) | ast:: uniq ( _) {
@@ -1145,17 +1145,17 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1145
1145
ast:: deref { none }
1146
1146
}
1147
1147
} ;
1148
- bot = check_expr ( fcx, oper , exp_inner) ;
1149
- let mut oper_t = fcx. expr_ty ( oper ) ;
1148
+ bot = check_expr ( fcx, oprnd , exp_inner) ;
1149
+ let mut oprnd_t = fcx. expr_ty ( oprnd ) ;
1150
1150
alt unop {
1151
1151
ast : : box ( mutbl) {
1152
- oper_t = ty:: mk_box ( tcx, { ty: oper_t , mutbl: mutbl} ) ;
1152
+ oprnd_t = ty:: mk_box ( tcx, { ty: oprnd_t , mutbl: mutbl} ) ;
1153
1153
}
1154
1154
ast:: uniq ( mutbl) {
1155
- oper_t = ty:: mk_uniq ( tcx, { ty: oper_t , mutbl: mutbl} ) ;
1155
+ oprnd_t = ty:: mk_uniq ( tcx, { ty: oprnd_t , mutbl: mutbl} ) ;
1156
1156
}
1157
1157
ast:: deref {
1158
- let sty = structure_of( fcx, expr. span, oper_t ) ;
1158
+ let sty = structure_of( fcx, expr. span, oprnd_t ) ;
1159
1159
1160
1160
// deref'ing an unsafe pointer requires that we be in an unsafe
1161
1161
// context
@@ -1169,7 +1169,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1169
1169
}
1170
1170
1171
1171
alt ty:: deref_sty ( tcx, sty, true ) {
1172
- some( mt) { oper_t = mt. ty }
1172
+ some( mt) { oprnd_t = mt. ty }
1173
1173
none {
1174
1174
alt sty {
1175
1175
ty : : ty_enum ( * ) {
@@ -1183,39 +1183,39 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
1183
1183
tcx. sess . span_err (
1184
1184
expr. span ,
1185
1185
#fmt[ "type %s cannot be dereferenced" ,
1186
- fcx. infcx . ty_to_str ( oper_t ) ] ) ;
1186
+ fcx. infcx . ty_to_str ( oprnd_t ) ] ) ;
1187
1187
}
1188
1188
}
1189
1189
}
1190
1190
}
1191
1191
}
1192
1192
ast:: not {
1193
- oper_t = structurally_resolved_type ( fcx, oper . span , oper_t ) ;
1194
- if !( ty:: type_is_integral ( oper_t ) ||
1195
- ty:: get ( oper_t ) . struct == ty:: ty_bool) {
1196
- oper_t = check_user_unop ( fcx, "!" , "!" , expr,
1197
- oper , oper_t ) ;
1193
+ oprnd_t = structurally_resolved_type ( fcx, oprnd . span , oprnd_t ) ;
1194
+ if !( ty:: type_is_integral ( oprnd_t ) ||
1195
+ ty:: get ( oprnd_t ) . struct == ty:: ty_bool) {
1196
+ oprnd_t = check_user_unop ( fcx, "!" , "!" , expr,
1197
+ oprnd , oprnd_t ) ;
1198
1198
}
1199
1199
}
1200
1200
ast:: neg {
1201
- oper_t = structurally_resolved_type ( fcx, oper . span , oper_t ) ;
1202
- if !( ty:: type_is_integral ( oper_t ) ||
1203
- ty:: type_is_fp ( oper_t ) ) {
1204
- oper_t = check_user_unop ( fcx, "-" , "unary-" , expr,
1205
- oper , oper_t ) ;
1201
+ oprnd_t = structurally_resolved_type ( fcx, oprnd . span , oprnd_t ) ;
1202
+ if !( ty:: type_is_integral ( oprnd_t ) ||
1203
+ ty:: type_is_fp ( oprnd_t ) ) {
1204
+ oprnd_t = check_user_unop ( fcx, "-" , "unary-" , expr,
1205
+ oprnd , oprnd_t ) ;
1206
1206
}
1207
1207
}
1208
1208
}
1209
- fcx. write_ty ( id, oper_t ) ;
1209
+ fcx. write_ty ( id, oprnd_t ) ;
1210
1210
}
1211
- ast:: expr_addr_of ( mutbl, oper ) {
1212
- bot = check_expr ( fcx, oper , unpack_expected ( fcx, expected) { |ty|
1211
+ ast:: expr_addr_of ( mutbl, oprnd ) {
1212
+ bot = check_expr ( fcx, oprnd , unpack_expected ( fcx, expected) { |ty|
1213
1213
alt ty { ty : : ty_rptr ( _, mt) { some ( mt. ty ) } _ { none } }
1214
1214
} ) ;
1215
- let region = region_of ( fcx, oper ) ;
1216
- let tm = { ty: fcx. expr_ty ( oper ) , mutbl: mutbl } ;
1217
- let oper_t = ty:: mk_rptr ( tcx, region, tm) ;
1218
- fcx. write_ty ( id, oper_t ) ;
1215
+ let region = region_of ( fcx, oprnd ) ;
1216
+ let tm = { ty: fcx. expr_ty ( oprnd ) , mutbl: mutbl } ;
1217
+ let oprnd_t = ty:: mk_rptr ( tcx, region, tm) ;
1218
+ fcx. write_ty ( id, oprnd_t ) ;
1219
1219
}
1220
1220
ast:: expr_path ( pth) {
1221
1221
let defn = lookup_def ( fcx, pth. span , id) ;
0 commit comments