diff --git a/src/comp/middle/trans_uniq.rs b/src/comp/middle/trans_uniq.rs index faa7c812054b..0986a0c12658 100644 --- a/src/comp/middle/trans_uniq.rs +++ b/src/comp/middle/trans_uniq.rs @@ -20,9 +20,7 @@ export trans_uniq, make_free_glue, type_is_unique_box, copy_val, autoderef, duplicate; pure fn type_is_unique_box(bcx: @block_ctxt, ty: ty::t) -> bool { - unchecked { - ty::type_is_unique_box(bcx_tcx(bcx), ty) - } + ty::type_is_unique_box(bcx_tcx(bcx), ty) } fn trans_uniq(cx: @block_ctxt, contents: @ast::expr, diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index a013359f3b0d..a91f7946c7d3 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -592,7 +592,7 @@ fn mk_iter_body_fn(cx: ctxt, output: t) -> t { } // Returns the one-level-deep type structure of the given type. -fn struct(cx: ctxt, typ: t) -> sty { ret interner::get(*cx.ts, typ).struct; } +pure fn struct(cx: ctxt, typ: t) -> sty { interner::get(*cx.ts, typ).struct } // Returns the canonical name of the given type. @@ -862,28 +862,28 @@ fn get_element_type(cx: ctxt, ty: t, i: uint) -> t { // tag. } -fn type_is_box(cx: ctxt, ty: t) -> bool { +pure fn type_is_box(cx: ctxt, ty: t) -> bool { alt struct(cx, ty) { ty_box(_) { ret true; } _ { ret false; } } } -fn type_is_boxed(cx: ctxt, ty: t) -> bool { +pure fn type_is_boxed(cx: ctxt, ty: t) -> bool { alt struct(cx, ty) { ty_box(_) { ret true; } _ { ret false; } } } -fn type_is_unique_box(cx: ctxt, ty: t) -> bool { +pure fn type_is_unique_box(cx: ctxt, ty: t) -> bool { alt struct(cx, ty) { ty_uniq(_) { ret true; } _ { ret false; } } } -fn type_is_vec(cx: ctxt, ty: t) -> bool { +pure fn type_is_vec(cx: ctxt, ty: t) -> bool { ret alt struct(cx, ty) { ty_vec(_) { true } ty_str. { true } @@ -891,7 +891,7 @@ fn type_is_vec(cx: ctxt, ty: t) -> bool { }; } -fn type_is_unique(cx: ctxt, ty: t) -> bool { +pure fn type_is_unique(cx: ctxt, ty: t) -> bool { alt struct(cx, ty) { ty_uniq(_) { ret true; } ty_vec(_) { true } @@ -900,7 +900,7 @@ fn type_is_unique(cx: ctxt, ty: t) -> bool { } } -fn type_is_scalar(cx: ctxt, ty: t) -> bool { +pure fn type_is_scalar(cx: ctxt, ty: t) -> bool { alt struct(cx, ty) { ty_nil. { ret true; } ty_bool. { ret true; } diff --git a/src/comp/syntax/util/interner.rs b/src/comp/syntax/util/interner.rs index ce1124d68aa9..164b38fe8705 100644 --- a/src/comp/syntax/util/interner.rs +++ b/src/comp/syntax/util/interner.rs @@ -28,7 +28,7 @@ fn intern<@T>(itr: interner, val: T) -> uint { } } -fn get<@T>(itr: interner, idx: uint) -> T { ret itr.vect[idx]; } +pure fn get<@T>(itr: interner, idx: uint) -> T { ret itr.vect[idx]; } -fn len(itr: interner) -> uint { ret vec::len(itr.vect); } +pure fn len(itr: interner) -> uint { ret vec::len(itr.vect); }