1
Fork 0

Extend the unchecked block stuff to allow unsafe blocks as well.

This commit is contained in:
Niko Matsakis 2011-10-06 16:42:27 -07:00 committed by Brian Anderson
parent 58b8e88356
commit 29584cc5ac
12 changed files with 114 additions and 35 deletions

View file

@ -185,13 +185,13 @@ fn eq_ty(&&a: @ty, &&b: @ty) -> bool { ret std::box::ptr_eq(a, b); }
fn hash_ty(&&t: @ty) -> uint { ret t.span.lo << 16u + t.span.hi; }
fn block_from_expr(e: @expr) -> blk {
let blk_ = checked_blk([], option::some::<@expr>(e), e.id);
let blk_ = checked_block([], option::some::<@expr>(e), e.id);
ret {node: blk_, span: e.span};
}
fn checked_blk(stmts1: [@stmt], expr1: option::t<@expr>, id1: node_id) ->
fn checked_block(stmts1: [@stmt], expr1: option::t<@expr>, id1: node_id) ->
blk_ {
ret {stmts: stmts1, expr: expr1, id: id1, rules: checked};
ret {stmts: stmts1, expr: expr1, id: id1, rules: checked_blk};
}
fn obj_field_from_anon_obj_field(f: anon_obj_field) -> obj_field {