1
Fork 0

make treatment of unchecked/unsafe blocks more uniform

also repair various errors in the parser related to such blocks.
rename checked_blk to default_blk to reflect the fact that it
inherits its purity from the surrounding context.
This commit is contained in:
Niko Matsakis 2011-10-07 15:51:55 -07:00 committed by Brian Anderson
parent e9569371f7
commit cbe8da0655
7 changed files with 28 additions and 20 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_block([], option::some::<@expr>(e), e.id);
let blk_ = default_block([], option::some::<@expr>(e), e.id);
ret {node: blk_, span: e.span};
}
fn checked_block(stmts1: [@stmt], expr1: option::t<@expr>, id1: node_id) ->
fn default_block(stmts1: [@stmt], expr1: option::t<@expr>, id1: node_id) ->
blk_ {
ret {stmts: stmts1, expr: expr1, id: id1, rules: checked_blk};
ret {stmts: stmts1, expr: expr1, id: id1, rules: default_blk};
}
fn obj_field_from_anon_obj_field(f: anon_obj_field) -> obj_field {