File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ pub fn read_crates(diag: span_handler,
55
55
visit_view_item : |a| visit_view_item ( e, a) ,
56
56
visit_item : |a| visit_item ( e, a) ,
57
57
.. * visit:: default_simple_visitor ( ) } ) ;
58
+ visit_crate ( e, crate ) ;
58
59
visit:: visit_crate ( crate , ( ) , v) ;
59
60
dump_crates ( e. crate_cache ) ;
60
61
warn_if_multiple_versions ( e, diag, e. crate_cache ) ;
@@ -125,6 +126,20 @@ struct Env {
125
126
intr : @ident_interner
126
127
}
127
128
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
+
128
143
fn visit_view_item ( e : @mut Env , i : @ast:: view_item ) {
129
144
match /*bad*/ copy i. node {
130
145
ast:: view_item_use( ident, meta_items, id) => {
You can’t perform that action at this time.
0 commit comments