Skip to content

Commit 10c31b7

Browse files
committed
---
yaml --- r: 29991 b: refs/heads/incoming c: 1b804ce h: refs/heads/master i: 29989: 5107b53 29987: 0868e5a 29983: 4775308 v: v3
1 parent c5f2063 commit 10c31b7

File tree

5 files changed

+12
-25
lines changed

5 files changed

+12
-25
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: 0a5f88a2406bf78a216ea8e2128441766dd7cd9c
9+
refs/heads/incoming: 1b804ce343a79fec2b08b88740782c1e8c081417
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libsyntax/attr.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,15 @@ fn remove_meta_items_by_name(items: ~[@ast::meta_item], name: ~str) ->
297297
});
298298
}
299299

300-
fn find_linkage_attrs(attrs: ~[ast::attribute]) -> ~[ast::attribute] {
301-
let mut found = ~[];
302-
for find_attrs_by_name(attrs, ~"link").each |attr| {
303-
match attr.node.value.node {
304-
ast::meta_list(_, _) => vec::push(found, attr),
305-
_ => debug!{"ignoring link attribute that has incorrect type"}
306-
}
307-
}
308-
return found;
309-
}
310-
311300
/**
312-
* From a list of crate attributes get only the meta_items that impact crate
301+
* From a list of crate attributes get only the meta_items that affect crate
313302
* linkage
314303
*/
315304
fn find_linkage_metas(attrs: ~[ast::attribute]) -> ~[@ast::meta_item] {
316-
do find_linkage_attrs(attrs).flat_map |attr| {
317-
match check attr.node.value.node {
318-
ast::meta_list(_, items) => /* FIXME (#2543) */ copy items
305+
do find_attrs_by_name(attrs, ~"link").flat_map |attr| {
306+
match attr.node.value.node {
307+
ast::meta_list(_, items) => /* FIXME (#2543) */ copy items,
308+
_ => ~[]
319309
}
320310
}
321311
}

branches/incoming/src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ fn item_to_str(i: @ast::item, intr: ident_interner) -> ~str {
117117
to_str(i, print_item, intr)
118118
}
119119

120-
fn attr_to_str(i: ast::attribute, intr: ident_interner) -> ~str {
121-
to_str(i, print_attribute, intr)
122-
}
123-
124120
fn typarams_to_str(tps: ~[ast::ty_param], intr: ident_interner) -> ~str {
125121
to_str(tps, print_type_params, intr)
126122
}
@@ -165,8 +161,8 @@ fn block_to_str(blk: ast::blk, intr: ident_interner) -> ~str {
165161
io::mem_buffer_str(buffer)
166162
}
167163

168-
fn meta_item_to_str(mi: ast::meta_item, intr: ident_interner) -> ~str {
169-
to_str(@mi, print_meta_item, intr)
164+
fn meta_item_to_str(mi: @ast::meta_item, intr: ident_interner) -> ~str {
165+
to_str(mi, print_meta_item, intr)
170166
}
171167

172168
fn attribute_to_str(attr: ast::attribute, intr: ident_interner) -> ~str {

branches/incoming/src/rustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ fn get_attributes(md: ebml::doc) -> ~[ast::attribute] {
823823
fn list_meta_items(intr: ident_interner,
824824
meta_items: ebml::doc, out: io::Writer) {
825825
for get_meta_items(meta_items).each |mi| {
826-
out.write_str(fmt!{"%s\n", pprust::meta_item_to_str(*mi, intr)});
826+
out.write_str(fmt!{"%s\n", pprust::meta_item_to_str(mi, intr)});
827827
}
828828
}
829829

branches/incoming/src/rustc/metadata/loader.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ fn crate_name_from_metas(metas: ~[@ast::meta_item]) -> ~str {
136136

137137
fn note_linkage_attrs(intr: ident_interner, diag: span_handler,
138138
attrs: ~[ast::attribute]) {
139-
for attr::find_linkage_attrs(attrs).each |attr| {
140-
diag.handler().note(fmt!{"meta: %s", pprust::attr_to_str(attr,intr)});
139+
for attr::find_linkage_metas(attrs).each |mi| {
140+
diag.handler().note(fmt!{"meta: %s",
141+
pprust::meta_item_to_str(mi,intr)});
141142
}
142143
}
143144

0 commit comments

Comments
 (0)