Skip to content

Commit 8047c0c

Browse files
committed
rustc: Typecheck dereference operations on safe references.
They require unsafe blocks for now. This will be removed once they typecheck properly.
1 parent 57596cb commit 8047c0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustc/middle/typeck.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,6 +2170,13 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
21702170
oper_t = inner.ty;
21712171
require_unsafe(tcx.sess, fcx.purity, expr.span);
21722172
}
2173+
ty::ty_rptr(_, inner) {
2174+
// FIXME: This shouldn't be unsafe for now, but we enforce it
2175+
// for now to safeguard the language until we're properly
2176+
// typechecking regions.
2177+
oper_t = inner.ty;
2178+
require_unsafe(tcx.sess, fcx.purity, expr.span);
2179+
}
21732180
_ {
21742181
tcx.sess.span_err(expr.span,
21752182
#fmt("Type %s cannot be dereferenced",

0 commit comments

Comments
 (0)