Skip to content

Commit 6e680e3

Browse files
committed
deprecate old style box shape strings
1 parent a6dde77 commit 6e680e3

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/comp/middle/shape.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ const shape_i32: u8 = 6u8;
4848
const shape_i64: u8 = 7u8;
4949
const shape_f32: u8 = 8u8;
5050
const shape_f64: u8 = 9u8;
51-
// (10 is currently unused, was evec)
51+
const shape_box: u8 = 10u8;
5252
const shape_vec: u8 = 11u8;
5353
const shape_enum: u8 = 12u8;
54-
const shape_box: u8 = 13u8;
54+
const shape_box_old: u8 = 13u8; // deprecated, remove after snapshot
5555
const shape_struct: u8 = 17u8;
5656
const shape_box_fn: u8 = 18u8;
5757
const shape_UNUSED: u8 = 19u8;
@@ -377,13 +377,8 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint]) -> [u8] {
377377
}
378378
}
379379
}
380-
ty::ty_box(mt) {
380+
ty::ty_box(_) | ty::ty_opaque_box {
381381
s += [shape_box];
382-
add_substr(s, shape_of(ccx, mt.ty, ty_param_map));
383-
}
384-
ty::ty_opaque_box {
385-
s += [shape_box];
386-
add_substr(s, [shape_u8]);
387382
}
388383
ty::ty_uniq(mt) {
389384
s += [shape_uniq];

src/rt/rust_shape.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ const uint8_t SHAPE_I32 = 6u;
4141
const uint8_t SHAPE_I64 = 7u;
4242
const uint8_t SHAPE_F32 = 8u;
4343
const uint8_t SHAPE_F64 = 9u;
44+
const uint8_t SHAPE_BOX = 10u;
4445
const uint8_t SHAPE_VEC = 11u;
4546
const uint8_t SHAPE_TAG = 12u;
46-
const uint8_t SHAPE_BOX = 13u;
47+
const uint8_t SHAPE_BOX_OLD = 13u; // remove after snapshot
4748
const uint8_t SHAPE_STRUCT = 17u;
4849
const uint8_t SHAPE_BOX_FN = 18u;
4950
const uint8_t SHAPE_OBJ = 19u;
@@ -257,6 +258,7 @@ class ctxt {
257258
void walk_vec0();
258259
void walk_tag0();
259260
void walk_box0();
261+
void walk_box_old0();
260262
void walk_uniq0();
261263
void walk_struct0();
262264
void walk_res0();
@@ -374,6 +376,7 @@ ctxt<T>::walk() {
374376
case SHAPE_VEC: walk_vec0(); break;
375377
case SHAPE_TAG: walk_tag0(); break;
376378
case SHAPE_BOX: walk_box0(); break;
379+
case SHAPE_BOX_OLD: walk_box_old0(); break;
377380
case SHAPE_STRUCT: walk_struct0(); break;
378381
case SHAPE_RES: walk_res0(); break;
379382
case SHAPE_VAR: walk_var0(); break;
@@ -482,6 +485,13 @@ ctxt<T>::walk_tag0() {
482485
template<typename T>
483486
void
484487
ctxt<T>::walk_box0() {
488+
static_cast<T *>(this)->walk_box1();
489+
}
490+
491+
template<typename T>
492+
void
493+
ctxt<T>::walk_box_old0() {
494+
// remove after snapshot
485495
uint16_t sp_size = get_u16_bump(sp);
486496
const uint8_t *end_sp = sp + sp_size;
487497

0 commit comments

Comments
 (0)