Skip to content

Commit fcde161

Browse files
committed
rustc: Stub typechecking for the address-of operator
1 parent d048a00 commit fcde161

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rustc/middle/typeck.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,9 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
21922192
}
21932193
}
21942194
ast::addr_of {
2195-
tcx.sess.bug("TODO pcwalton");
2195+
// FIXME: This is incorrect. Infer the proper region.
2196+
let tm = { ty: oper_t, mutbl: ast::m_imm };
2197+
oper_t = ty::mk_rptr(tcx, ty::re_block(0), tm);
21962198
}
21972199
}
21982200
write_ty(tcx, id, oper_t);

0 commit comments

Comments
 (0)