File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 376b35e6186d68e431b32b6632bf52f5433ab4d7
2
+ refs/heads/master: b79de6b76cbdcb8f2a8e44433d262c3389f28058
Original file line number Diff line number Diff line change @@ -1223,7 +1223,23 @@ fn check_expr(&fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
1223
1223
case ( ast. expr_unary ( ?unop, ?oper, _) ) {
1224
1224
auto oper_1 = check_expr ( fcx, oper) ;
1225
1225
auto oper_t = expr_ty ( oper_1) ;
1226
- // FIXME: Unops have a bit more subtlety than this.
1226
+ alt ( unop) {
1227
+ case ( ast. box ) { oper_t = plain_ty ( ty_box ( oper_t) ) ; }
1228
+ case ( ast. deref ) {
1229
+ alt ( oper_t. struct ) {
1230
+ case ( ty_box ( ?inner_t) ) {
1231
+ oper_t = inner_t;
1232
+ }
1233
+ case ( _) {
1234
+ fcx. ccx . sess . span_err
1235
+ ( expr. span ,
1236
+ "dereferencing non-box type: "
1237
+ + ty_to_str ( oper_t) ) ;
1238
+ }
1239
+ }
1240
+ }
1241
+ case ( _) { /* fall through */ }
1242
+ }
1227
1243
ret @fold. respan [ ast. expr_ ] ( expr. span ,
1228
1244
ast. expr_unary ( unop, oper_1,
1229
1245
ast. ann_type ( oper_t) ) ) ;
You can’t perform that action at this time.
0 commit comments