Skip to content

Commit e8ac65b

Browse files
committed
---
yaml --- r: 63895 b: refs/heads/snap-stage3 c: b914162 h: refs/heads/master i: 63893: 969874f 63891: 0023271 63887: 015cb29 v: v3
1 parent 40d7293 commit e8ac65b

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b883d6a54c460f8357b1107b3599108eb1f8580b
4+
refs/heads/snap-stage3: b91416214ed0e24b780dec8608a122b6b3a943f5
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/foreign.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,12 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
751751
C_bool(ty::type_needs_drop(ccx.tcx, tp_ty)),
752752
fcx.llretptr.get());
753753
}
754+
"contains_managed" => {
755+
let tp_ty = substs.tys[0];
756+
Store(bcx,
757+
C_bool(ty::type_contents(ccx.tcx, tp_ty).contains_managed()),
758+
fcx.llretptr.get());
759+
}
754760
"visit_tydesc" => {
755761
let td = get_param(decl, first_real_arg);
756762
let visitor = get_param(decl, first_real_arg + 1u);

branches/snap-stage3/src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub fn type_uses_for(ccx: @mut CrateContext, fn_id: def_id, n_tps: uint)
127127
"uninit" | "init" | "transmute" | "move_val" |
128128
"move_val_init" => use_repr,
129129

130-
"get_tydesc" | "needs_drop" => use_tydesc,
130+
"get_tydesc" | "needs_drop" | "contains_managed" => use_tydesc,
131131

132132
"visit_tydesc" | "forget" | "frame_address" |
133133
"morestack_addr" => 0,

branches/snap-stage3/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3540,7 +3540,7 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
35403540
ty::mk_nil())
35413541
}
35423542
"needs_drop" => (1u, ~[], ty::mk_bool()),
3543-
3543+
"contains_managed" => (1u, ~[], ty::mk_bool()),
35443544
"atomic_xchg" | "atomic_xadd" | "atomic_xsub" |
35453545
"atomic_xchg_acq" | "atomic_xadd_acq" | "atomic_xsub_acq" |
35463546
"atomic_xchg_rel" | "atomic_xadd_rel" | "atomic_xsub_rel" => {

branches/snap-stage3/src/libstd/unstable/intrinsics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ pub extern "rust-intrinsic" {
308308
/// Returns `true` if a type requires drop glue.
309309
pub fn needs_drop<T>() -> bool;
310310

311+
/// Returns `true` if a type is managed (will be allocated on the local heap)
312+
#[cfg(not(stage0))]
313+
pub fn contains_managed<T>() -> bool;
314+
311315
#[cfg(not(stage0))]
312316
pub fn visit_tydesc(td: *TyDesc, tv: @TyVisitor);
313317

0 commit comments

Comments
 (0)