Skip to content

Commit 4feb25f

Browse files
committed
---
yaml --- r: 39410 b: refs/heads/incoming c: 41c0d70 h: refs/heads/master v: v3
1 parent 42ae34a commit 4feb25f

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 8a9ccf81b056baf493f22d31f31c642d5ca47fb7
9+
refs/heads/incoming: 41c0d7083e19b0940fafb8b452ac24d5403f532b
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/librustc/middle/trans/type_use.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,18 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
139139
ast_map::node_dtor(_, dtor, _, _) => {
140140
handle_body(cx, dtor.node.body);
141141
}
142-
_ => fail ~"unknown node type in type_use"
142+
ast_map::node_struct_ctor(*) => {
143+
// Similarly to node_variant, this monomorphized function just uses
144+
// the representations of all of its type parameters.
145+
for uint::range(0, n_tps) |n| { cx.uses[n] |= use_repr; }
146+
}
147+
_ => {
148+
ccx.tcx.sess.bug(fmt!("unknown node type in type_use: %s",
149+
ast_map::node_id_to_str(
150+
ccx.tcx.items,
151+
fn_id_loc.node,
152+
ccx.tcx.sess.parse_sess.interner)));
153+
}
143154
}
144155
let uses = vec::from_mut(copy cx.uses);
145156
ccx.type_use_cache.insert(fn_id, uses);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
struct S<T>(T);
2+
3+
fn main() {
4+
let s = S(2);
5+
io::println(s.to_str());
6+
}
7+

0 commit comments

Comments
 (0)