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,
}
// 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.
// 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 }
};
}
-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 }
}
}
-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; }
}
}
-fn get<@T>(itr: interner<T>, idx: uint) -> T { ret itr.vect[idx]; }
+pure fn get<@T>(itr: interner<T>, idx: uint) -> T { ret itr.vect[idx]; }
-fn len<T>(itr: interner<T>) -> uint { ret vec::len(itr.vect); }
+pure fn len<T>(itr: interner<T>) -> uint { ret vec::len(itr.vect); }