Skip to content

Commit 3607c39

Browse files
committed
---
yaml --- r: 52730 b: refs/heads/dist-snap c: 0d1058a h: refs/heads/master v: v3
1 parent 367d126 commit 3607c39

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 6102d2abf293ac0f9ab37a64d43f1182f90bbcc6
10+
refs/heads/dist-snap: 0d1058a62e728f0dfed04fe93cc38dcf6be38f0b
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/dvec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ impl<A> DVec<A> {
180180
data <-> self.data;
181181
let data_ptr: *() = cast::reinterpret_cast(&data);
182182
if data_ptr.is_null() { fail ~"Recursive use of dvec"; }
183+
log(error, ~"a");
183184
self.data = move ~[move t];
184185
self.data.push_all_move(move data);
186+
log(error, ~"b");
185187
}
186188
}
187189

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ pub fn trans_struct_dtor(ccx: @crate_ctxt,
19861986
}
19871987

19881988
pub fn trans_enum_def(ccx: @crate_ctxt, enum_definition: ast::enum_def,
1989-
id: ast::node_id, tps: ~[ast::ty_param], degen: bool,
1989+
id: ast::node_id, degen: bool,
19901990
path: @ast_map::path, vi: @~[ty::VariantInfo],
19911991
i: &mut uint) {
19921992
for vec::each(enum_definition.variants) |variant| {
@@ -2003,14 +2003,13 @@ pub fn trans_enum_def(ccx: @crate_ctxt, enum_definition: ast::enum_def,
20032003
// Nothing to do.
20042004
}
20052005
ast::struct_variant_kind(struct_def) => {
2006-
trans_struct_def(ccx, struct_def, /*bad*/copy tps, path,
2006+
trans_struct_def(ccx, struct_def, path,
20072007
variant.node.id);
20082008
}
20092009
ast::enum_variant_kind(ref enum_definition) => {
20102010
trans_enum_def(ccx,
20112011
*enum_definition,
20122012
id,
2013-
/*bad*/copy tps,
20142013
degen,
20152014
path,
20162015
vi,
@@ -2062,11 +2061,11 @@ pub fn trans_item(ccx: @crate_ctxt, item: ast::item) {
20622061
trans_mod(ccx, m);
20632062
}
20642063
ast::item_enum(ref enum_definition, ref tps) => {
2065-
if tps.len() == 0u {
2064+
if tps.is_empty() {
20662065
let degen = (*enum_definition).variants.len() == 1u;
20672066
let vi = ty::enum_variants(ccx.tcx, local_def(item.id));
20682067
let mut i = 0;
2069-
trans_enum_def(ccx, (*enum_definition), item.id, /*bad*/copy *tps,
2068+
trans_enum_def(ccx, (*enum_definition), item.id,
20702069
degen, path, vi, &mut i);
20712070
}
20722071
}
@@ -2080,35 +2079,33 @@ pub fn trans_item(ccx: @crate_ctxt, item: ast::item) {
20802079
foreign::trans_foreign_mod(ccx, foreign_mod, abi);
20812080
}
20822081
ast::item_struct(struct_def, tps) => {
2083-
trans_struct_def(ccx, struct_def, tps, path, item.id);
2082+
if tps.is_empty() {
2083+
trans_struct_def(ccx, struct_def, path, item.id);
2084+
}
20842085
}
20852086
_ => {/* fall through */ }
20862087
}
20872088
}
20882089

20892090
pub fn trans_struct_def(ccx: @crate_ctxt, struct_def: @ast::struct_def,
2090-
tps: ~[ast::ty_param], path: @ast_map::path,
2091+
path: @ast_map::path,
20912092
id: ast::node_id) {
2092-
// If there are type parameters, the destructor and constructor will be
2093-
// monomorphized, so we don't translate them here.
2094-
if tps.len() == 0u {
2095-
// Translate the destructor.
2096-
do option::iter(&struct_def.dtor) |dtor| {
2097-
trans_struct_dtor(ccx, /*bad*/copy *path, dtor.node.body,
2098-
dtor.node.id, None, None, local_def(id));
2099-
};
2093+
// Translate the destructor.
2094+
do option::iter(&struct_def.dtor) |dtor| {
2095+
trans_struct_dtor(ccx, /*bad*/copy *path, dtor.node.body,
2096+
dtor.node.id, None, None, local_def(id));
2097+
};
21002098

2101-
// If this is a tuple-like struct, translate the constructor.
2102-
match struct_def.ctor_id {
2103-
// We only need to translate a constructor if there are fields;
2104-
// otherwise this is a unit-like struct.
2105-
Some(ctor_id) if struct_def.fields.len() > 0 => {
2106-
let llfndecl = get_item_val(ccx, ctor_id);
2107-
trans_tuple_struct(ccx, /*bad*/copy struct_def.fields,
2108-
ctor_id, None, llfndecl);
2109-
}
2110-
Some(_) | None => {}
2099+
// If this is a tuple-like struct, translate the constructor.
2100+
match struct_def.ctor_id {
2101+
// We only need to translate a constructor if there are fields;
2102+
// otherwise this is a unit-like struct.
2103+
Some(ctor_id) if struct_def.fields.len() > 0 => {
2104+
let llfndecl = get_item_val(ccx, ctor_id);
2105+
trans_tuple_struct(ccx, /*bad*/copy struct_def.fields,
2106+
ctor_id, None, llfndecl);
21112107
}
2108+
Some(_) | None => {}
21122109
}
21132110
}
21142111

0 commit comments

Comments
 (0)