Skip to content

Commit bcff301

Browse files
committed
---
yaml --- r: 44110 b: refs/heads/snap-stage3 c: 19eb225 h: refs/heads/master v: v3
1 parent ce144ee commit bcff301

File tree

4 files changed

+31
-32
lines changed

4 files changed

+31
-32
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: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fe9f1d155ab674e402cdb1b530df8ecb66bb7dd4
4+
refs/heads/snap-stage3: 19eb225bc2725202c02e3d520876bab25dc026d1
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
497497

498498
let cmh_items = attr::sort_meta_items(cmh_items);
499499

500-
fn hash(symbol_hasher: &hash::State, m: &@ast::meta_item) {
500+
symbol_hasher.reset();
501+
for cmh_items.each |m| {
501502
match m.node {
502503
ast::meta_name_value(ref key, value) => {
503504
symbol_hasher.write_str(len_and_str((*key)));
@@ -506,20 +507,13 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
506507
ast::meta_word(ref name) => {
507508
symbol_hasher.write_str(len_and_str((*name)));
508509
}
509-
ast::meta_list(ref name, ref mis) => {
510-
symbol_hasher.write_str(len_and_str((*name)));
511-
for mis.each |m_| {
512-
hash(symbol_hasher, m_);
513-
}
510+
ast::meta_list(_, _) => {
511+
// FIXME (#607): Implement this
512+
fail!(~"unimplemented meta_item variant");
514513
}
515514
}
516515
}
517516
518-
symbol_hasher.reset();
519-
for cmh_items.each |m| {
520-
hash(symbol_hasher, m);
521-
}
522-
523517
for dep_hashes.each |dh| {
524518
symbol_hasher.write_str(len_and_str(*dh));
525519
}

branches/snap-stage3/src/librustc/metadata/creader.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub fn read_crates(diag: span_handler,
5555
visit_view_item: |a| visit_view_item(e, a),
5656
visit_item: |a| visit_item(e, a),
5757
.. *visit::default_simple_visitor()});
58+
visit_crate(e, crate);
5859
visit::visit_crate(crate, (), v);
5960
dump_crates(e.crate_cache);
6061
warn_if_multiple_versions(e, diag, e.crate_cache);
@@ -125,6 +126,20 @@ struct Env {
125126
intr: @ident_interner
126127
}
127128

129+
fn visit_crate(e: @mut Env, c: ast::crate) {
130+
let cstore = e.cstore;
131+
let link_args = attr::find_attrs_by_name(c.node.attrs, "link_args");
132+
133+
for link_args.each |a| {
134+
match attr::get_meta_item_value_str(attr::attr_meta(*a)) {
135+
Some(ref linkarg) => {
136+
cstore::add_used_link_args(cstore, (/*bad*/copy *linkarg));
137+
}
138+
None => {/* fallthrough */ }
139+
}
140+
}
141+
}
142+
128143
fn visit_view_item(e: @mut Env, i: @ast::view_item) {
129144
match /*bad*/copy i.node {
130145
ast::view_item_use(ident, meta_items, id) => {

branches/snap-stage3/src/libsyntax/attr.rs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,13 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
192192
}
193193
_ => false
194194
},
195-
ast::meta_list(ref na, misa) => match b.node {
196-
ast::meta_list(ref nb, misb) => {
197-
if na != nb { return false; }
198-
for misa.each |&mi| {
199-
if !contains(misb, mi) { return false; }
200-
}
201-
true
202-
}
203-
_ => false
195+
ast::meta_list(*) => {
196+
197+
// ~[Fixme-sorting]
198+
// FIXME (#607): Needs implementing
199+
// This involves probably sorting the list by name and
200+
// meta_item variant
201+
fail!(~"unimplemented meta_item variant")
204202
}
205203
}
206204
}
@@ -255,6 +253,8 @@ pub fn last_meta_item_list_by_name(items: ~[@ast::meta_item], name: ~str)
255253
256254
/* Higher-level applications */
257255
256+
// FIXME (#607): This needs to sort by meta_item variant in addition to
257+
// the item name (See [Fixme-sorting])
258258
pub fn sort_meta_items(+items: ~[@ast::meta_item]) -> ~[@ast::meta_item] {
259259
pure fn lteq(ma: &@ast::meta_item, mb: &@ast::meta_item) -> bool {
260260
pure fn key(m: &ast::meta_item) -> ~str {
@@ -270,17 +270,7 @@ pub fn sort_meta_items(+items: ~[@ast::meta_item]) -> ~[@ast::meta_item] {
270270
// This is sort of stupid here, converting to a vec of mutables and back
271271
let mut v: ~[@ast::meta_item] = items;
272272
std::sort::quick_sort(v, lteq);
273-
274-
// There doesn't seem to be a more optimal way to do this
275-
do v.map |&m| {
276-
match m.node {
277-
ast::meta_list(n, mis) => @spanned {
278-
node: ast::meta_list(n, sort_meta_items(mis)),
279-
.. *m
280-
},
281-
_ => m
282-
}
283-
}
273+
v
284274
}
285275
286276
pub fn remove_meta_items_by_name(items: ~[@ast::meta_item], name: ~str) ->

0 commit comments

Comments
 (0)