Skip to content

Commit f2cd33d

Browse files
nikomatsakisbrson
authored andcommitted
continue to annotate trans functions as unsafe where neccessary
1 parent 2094668 commit f2cd33d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/comp/middle/gc.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ type ctxt = @{mutable next_tydesc_num: uint};
1616

1717
fn mk_ctxt() -> ctxt { ret @{mutable next_tydesc_num: 0u}; }
1818

19-
fn add_global(ccx: @crate_ctxt, llval: ValueRef, name: str) -> ValueRef {
19+
fn add_global(ccx: @crate_ctxt, llval: ValueRef, name: str)
20+
-> ValueRef unsafe {
2021
let llglobal =
2122
str::as_buf(name,
2223
{|buf|
@@ -27,7 +28,8 @@ fn add_global(ccx: @crate_ctxt, llval: ValueRef, name: str) -> ValueRef {
2728
ret llglobal;
2829
}
2930

30-
fn add_gc_root(cx: @block_ctxt, llval: ValueRef, ty: ty::t) -> @block_ctxt {
31+
fn add_gc_root(cx: @block_ctxt, llval: ValueRef, ty: ty::t) ->
32+
@block_ctxt unsafe {
3133
let bcx = cx;
3234
if !type_is_gc_relevant(bcx_tcx(cx), ty) ||
3335
ty::type_has_dynamic_size(bcx_tcx(cx), ty) {

src/comp/middle/shape.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn eq_res_info(a: res_info, b: res_info) -> bool {
7272
}
7373

7474
fn mk_global(ccx: @crate_ctxt, name: str, llval: ValueRef, internal: bool) ->
75-
ValueRef {
75+
ValueRef unsafe {
7676
let llglobal =
7777
str::as_buf(name,
7878
{|buf|
@@ -245,7 +245,7 @@ fn s_float(_tcx: ty_ctxt) -> u8 {
245245
ret shape_f64; // TODO: x86-64
246246
}
247247

248-
fn mk_ctxt(llmod: ModuleRef) -> ctxt {
248+
fn mk_ctxt(llmod: ModuleRef) -> ctxt unsafe {
249249
let llshapetablesty = trans_common::T_named_struct("shapes");
250250
let llshapetables =
251251
str::as_buf("shapes",
@@ -580,7 +580,7 @@ fn gen_resource_shapes(ccx: @crate_ctxt) -> ValueRef {
580580
ret mk_global(ccx, "resource_shapes", C_struct(dtors), true);
581581
}
582582

583-
fn gen_shape_tables(ccx: @crate_ctxt) {
583+
fn gen_shape_tables(ccx: @crate_ctxt) unsafe {
584584
let lltagstable = gen_tag_shapes(ccx);
585585
let llresourcestable = gen_resource_shapes(ccx);
586586
trans_common::set_struct_body(ccx.shape_cx.llshapetablesty,

0 commit comments

Comments
 (0)