Skip to content

Commit b4858c8

Browse files
committed
---
yaml --- r: 10732 b: refs/heads/snap-stage3 c: cf69604 h: refs/heads/master v: v3
1 parent 65e4bca commit b4858c8

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d513d9893ecd416943d96822f794c3212c8b60b8
4+
refs/heads/snap-stage3: cf69604551324f68d1fc7ab0386ecbe9e1aaa504
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/src/rustc/middle/ty.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,6 @@ fn type_needs_drop(cx: ctxt, ty: t) -> bool {
12181218
accum
12191219
}
12201220
}
1221-
12221221
ty_tup(elts) {
12231222
for elts.each {|m| if type_needs_drop(cx, m) { accum = true; } }
12241223
accum
@@ -1720,6 +1719,7 @@ fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
17201719
fn type_structurally_contains(cx: ctxt, ty: t, test: fn(sty) -> bool) ->
17211720
bool {
17221721
let sty = get(ty).struct;
1722+
#debug("type_structurally_contains: %s", ty_to_str(cx, ty));
17231723
if test(sty) { ret true; }
17241724
alt sty {
17251725
ty_enum(did, substs) {
@@ -1737,6 +1737,14 @@ fn type_structurally_contains(cx: ctxt, ty: t, test: fn(sty) -> bool) ->
17371737
}
17381738
ret false;
17391739
}
1740+
ty_class(did, substs) {
1741+
for lookup_class_fields(cx, did).each {|field|
1742+
let ft = lookup_field_type(cx, did, field.id, substs);
1743+
if type_structurally_contains(cx, ft, test) { ret true; }
1744+
}
1745+
ret false;
1746+
}
1747+
17401748
ty_tup(ts) {
17411749
for ts.each {|tt|
17421750
if type_structurally_contains(cx, tt, test) { ret true; }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class send_packet<T: copy> {
2+
let p: T;
3+
new(p: T) { self.p = p; }
4+
}
5+
6+
7+
mod pingpong {
8+
type ping = send_packet<pong>;
9+
enum pong = send_packet<ping>; //! ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
10+
}
11+
12+
fn main() {}

0 commit comments

Comments
 (0)