Skip to content

Commit 2b49c6e

Browse files
committed
---
yaml --- r: 34133 b: refs/heads/snap-stage3 c: 41c0d70 h: refs/heads/master i: 34131: 97b64e0 v: v3
1 parent 647a130 commit 2b49c6e

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 8a9ccf81b056baf493f22d31f31c642d5ca47fb7
4+
refs/heads/snap-stage3: 41c0d7083e19b0940fafb8b452ac24d5403f532b
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)