Skip to content

Commit 0727901

Browse files
committed
librustc: De-@mut the type descriptor info
1 parent e9b9c82 commit 0727901

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ pub fn get_tydesc_simple(ccx: &CrateContext, t: ty::t) -> ValueRef {
445445
get_tydesc(ccx, t).tydesc
446446
}
447447

448-
pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @mut tydesc_info {
448+
pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
449449
{
450450
let tydescs = ccx.tydescs.borrow();
451451
match tydescs.get().find(&t) {

src/librustc/middle/trans/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub struct CrateContext {
5252
reachable: @RefCell<HashSet<ast::NodeId>>,
5353
item_symbols: RefCell<HashMap<ast::NodeId, ~str>>,
5454
link_meta: LinkMeta,
55-
tydescs: RefCell<HashMap<ty::t, @mut tydesc_info>>,
55+
tydescs: RefCell<HashMap<ty::t, @tydesc_info>>,
5656
// Set when running emit_tydescs to enforce that no more tydescs are
5757
// created.
5858
finished_tydescs: Cell<bool>,

src/librustc/middle/trans/glue.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn free_ty_immediate(bcx: @Block, v: ValueRef, t: ty::t) -> @Block {
110110
}
111111

112112
pub fn lazily_emit_all_tydesc_glue(ccx: @CrateContext,
113-
static_ti: @mut tydesc_info) {
113+
static_ti: @tydesc_info) {
114114
lazily_emit_tydesc_glue(ccx, abi::tydesc_field_take_glue, static_ti);
115115
lazily_emit_tydesc_glue(ccx, abi::tydesc_field_drop_glue, static_ti);
116116
lazily_emit_tydesc_glue(ccx, abi::tydesc_field_free_glue, static_ti);
@@ -176,7 +176,8 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t {
176176

177177
pub fn lazily_emit_simplified_tydesc_glue(ccx: @CrateContext,
178178
field: uint,
179-
ti: &mut tydesc_info) -> bool {
179+
ti: &tydesc_info)
180+
-> bool {
180181
let _icx = push_ctxt("lazily_emit_simplified_tydesc_glue");
181182
let simpl = simplified_glue_type(ccx.tcx, field, ti.ty);
182183
if simpl != ti.ty {
@@ -201,7 +202,7 @@ pub fn lazily_emit_simplified_tydesc_glue(ccx: @CrateContext,
201202

202203
pub fn lazily_emit_tydesc_glue(ccx: @CrateContext,
203204
field: uint,
204-
ti: @mut tydesc_info) {
205+
ti: @tydesc_info) {
205206
let _icx = push_ctxt("lazily_emit_tydesc_glue");
206207
let llfnty = Type::glue_fn(type_of(ccx, ti.ty).ptr_to());
207208

@@ -269,7 +270,7 @@ pub fn call_tydesc_glue_full(bcx: @Block,
269270
v: ValueRef,
270271
tydesc: ValueRef,
271272
field: uint,
272-
static_ti: Option<@mut tydesc_info>) {
273+
static_ti: Option<@tydesc_info>) {
273274
let _icx = push_ctxt("call_tydesc_glue_full");
274275
let ccx = bcx.ccx();
275276
// NB: Don't short-circuit even if this block is unreachable because
@@ -587,7 +588,7 @@ pub fn incr_refcnt_of_boxed(cx: @Block, box_ptr: ValueRef) {
587588

588589

589590
// Generates the declaration for (but doesn't emit) a type descriptor.
590-
pub fn declare_tydesc(ccx: &CrateContext, t: ty::t) -> @mut tydesc_info {
591+
pub fn declare_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
591592
// If emit_tydescs already ran, then we shouldn't be creating any new
592593
// tydescs.
593594
assert!(!ccx.finished_tydescs.get());
@@ -624,7 +625,7 @@ pub fn declare_tydesc(ccx: &CrateContext, t: ty::t) -> @mut tydesc_info {
624625

625626
let ty_name = C_estr_slice(ccx, ppaux::ty_to_str(ccx.tcx, t).to_managed());
626627

627-
let inf = @mut tydesc_info {
628+
let inf = @tydesc_info {
628629
ty: t,
629630
tydesc: gvar,
630631
size: llsize,

0 commit comments

Comments
 (0)