Skip to content

Commit 8f32114

Browse files
committed
---
yaml --- r: 29759 b: refs/heads/incoming c: b1ec0a5 h: refs/heads/master i: 29757: e248722 29755: 8e26040 29751: f24a0c4 29743: 34ccb5c 29727: 4e102a0 29695: 1c16e97 v: v3
1 parent fad66c6 commit 8f32114

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 0e0833e0b038ea3015a2036e0c9431f6c60db82f
9+
refs/heads/incoming: b1ec0a582e16cb6e21d9199c9b6df0f8c4c8f00c
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/rustc/middle/trans/base.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5217,12 +5217,13 @@ fn get_dtor_symbol(ccx: @crate_ctxt, path: path, id: ast::node_id,
52175217
}
52185218

52195219
fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
5220+
debug!{"get_item_val(id=`%?`)", id};
52205221
let tcx = ccx.tcx;
52215222
match ccx.item_vals.find(id) {
52225223
some(v) => v,
52235224
none => {
52245225
let mut exprt = false;
5225-
let val = match check ccx.tcx.items.get(id) {
5226+
let val = match ccx.tcx.items.get(id) {
52265227
ast_map::node_item(i, pth) => {
52275228
let my_path = vec::append(*pth, ~[path_name(i.ident)]);
52285229
match check i.node {
@@ -5246,11 +5247,33 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
52465247
}
52475248
}
52485249
}
5250+
ast_map::node_trait_method(trait_method, _, pth) => {
5251+
debug!{"get_item_val(): processing a node_trait_method"};
5252+
match *trait_method {
5253+
ast::required(_) => {
5254+
ccx.sess.bug(~"unexpected variant: required trait method in \
5255+
get_item_val()");
5256+
}
5257+
ast::provided(m) => {
5258+
// FIXME (#2794): Default methods currently compiling but not
5259+
// linking successfully; not sure if this is correct. It's
5260+
// just copypasta from the node_method case.
5261+
exprt = true;
5262+
let mty = ty::node_id_to_type(ccx.tcx, id);
5263+
let pth =
5264+
vec::append(*pth, ~[path_name(@ccx.names(~"meth")),
5265+
path_name(m.ident)]);
5266+
let llfn = register_fn_full(ccx, m.span, pth, id, mty);
5267+
set_inline_hint_if_appr(m.attrs, llfn);
5268+
llfn
5269+
}
5270+
}
5271+
}
52495272
ast_map::node_method(m, impl_id, pth) => {
52505273
exprt = true;
52515274
let mty = ty::node_id_to_type(ccx.tcx, id);
52525275
let pth = vec::append(*pth, ~[path_name(@ccx.names(~"meth")),
5253-
path_name(m.ident)]);
5276+
path_name(m.ident)]);
52545277
let llfn = register_fn_full(ccx, m.span, pth, id, mty);
52555278
set_inline_hint_if_appr(m.attrs, llfn);
52565279
llfn
@@ -5310,6 +5333,9 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
53105333
set_inline_hint(llfn);
53115334
llfn
53125335
}
5336+
_ => {
5337+
ccx.sess.bug(~"get_item_val(): unexpected variant");
5338+
}
53135339
};
53145340
if !(exprt || ccx.reachable.contains_key(id)) {
53155341
lib::llvm::SetLinkage(val, lib::llvm::InternalLinkage);

0 commit comments

Comments
 (0)