Skip to content

Commit d90ad44

Browse files
committed
rustc: Work around leak when translating interior vectors. Un-XFAIL interior-vec.rs.
1 parent 5b34144 commit d90ad44

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/comp/middle/trans.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3456,12 +3456,16 @@ mod ivec {
34563456
cx.fcx.lcx.ccx.tcx.sess.bug("non-istr/ivec in trans_append");
34573457
}
34583458
}
3459+
34593460
// Gather the various type descriptors we'll need.
34603461

3461-
auto rslt = get_tydesc(cx, t, false, none);
3462+
// FIXME (issue #511): This is needed to prevent a leak.
3463+
auto no_tydesc_info = none;
3464+
3465+
auto rslt = get_tydesc(cx, t, false, no_tydesc_info);
34623466
auto vec_tydesc = rslt.val;
34633467
auto bcx = rslt.bcx;
3464-
rslt = get_tydesc(bcx, unit_ty, false, none);
3468+
rslt = get_tydesc(bcx, unit_ty, false, no_tydesc_info);
34653469
auto unit_tydesc = rslt.val;
34663470
bcx = rslt.bcx;
34673471

src/test/run-pass/interior-vec.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
// xfail-stage0
2-
// xfail-stage1
3-
// xfail-stage2
4-
// xfail-stage3
5-
6-
// works, but leaks in the compiler :(
72

83
import rusti::ivec_len;
94

0 commit comments

Comments
 (0)