From fcde161f4f9b686a790da52653a0a810bf09d487 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 8 Mar 2012 14:54:51 -0800 Subject: [PATCH] rustc: Stub typechecking for the address-of operator --- src/rustc/middle/typeck.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index f292ceddfff6..8770a109f1db 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -2192,7 +2192,9 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier, } } ast::addr_of { - tcx.sess.bug("TODO pcwalton"); + // FIXME: This is incorrect. Infer the proper region. + let tm = { ty: oper_t, mutbl: ast::m_imm }; + oper_t = ty::mk_rptr(tcx, ty::re_block(0), tm); } } write_ty(tcx, id, oper_t);