Skip to content

Commit 3bf5057

Browse files
committed
---
yaml --- r: 14583 b: refs/heads/try c: d3a0f7e h: refs/heads/master i: 14581: bee55ad 14579: 7678dca 14575: 12955bd v: v3
1 parent 0de1cbe commit 3bf5057

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 6473a87cec100682764f4d926541fc7eb455b00c
5+
refs/heads/try: d3a0f7e9fc336e2912a0006b4c71d19752000fea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/metadata/encoder.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,8 @@ type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>;
2929

3030
type encode_ctxt = {ccx: crate_ctxt, type_abbrevs: abbrev_map};
3131

32-
fn should_inline(path: ast_map::path, item: @item) -> bool {
33-
if item.ident == "iter" { // XXX
34-
#debug["should_inline(%s::%s)? attrs=%s result=%b",
35-
ast_map::path_to_str(path),
36-
item.ident,
37-
str::connect(vec::map(item.attrs, pprust::attr_to_str), ", "),
38-
attr::attrs_contains_name(item.attrs, "inline")];
39-
}
40-
41-
attr::attrs_contains_name(item.attrs, "inline")
32+
fn should_inline(_path: ast_map::path, attrs: [attribute]) -> bool {
33+
attr::attrs_contains_name(attrs, "inline")
4234
}
4335

4436
// Path table encoding
@@ -351,7 +343,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
351343
encode_type(ecx, ebml_w, node_id_to_type(tcx, item.id));
352344
encode_symbol(ecx, ebml_w, item.id);
353345
encode_path(ebml_w, path, ast_map::path_name(item.ident));
354-
if should_inline(path, item) {
346+
if should_inline(path, item.attrs) {
355347
astencode::encode_inlined_item(ecx, ebml_w, path, ii_item(item));
356348
}
357349
ebml_w.end_tag();
@@ -454,6 +446,11 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
454446
encode_name(ebml_w, m.ident);
455447
encode_symbol(ecx, ebml_w, m.id);
456448
encode_path(ebml_w, impl_path, ast_map::path_name(m.ident));
449+
if should_inline(path, m.attrs) {
450+
astencode::encode_inlined_item(
451+
ecx, ebml_w, impl_path,
452+
ii_method(local_def(item.id), m));
453+
}
457454
ebml_w.end_tag();
458455
}
459456
}

0 commit comments

Comments
 (0)