@@ -24,7 +24,6 @@ fn read_crates(sess: session::session, crate: ast::crate) {
24
24
let e =
25
25
@{ sess: sess,
26
26
crate_cache: @std:: map:: new_str_hash :: < int > ( ) ,
27
- library_search_paths: sess. filesearch ( ) . lib_search_paths ( ) ,
28
27
mutable next_crate_num: 1 } ;
29
28
let v =
30
29
visit:: mk_simple_visitor ( @{ visit_view_item:
@@ -37,7 +36,6 @@ fn read_crates(sess: session::session, crate: ast::crate) {
37
36
type env =
38
37
@{ sess : session:: session ,
39
38
crate_cache : @hashmap < str , int > ,
40
- library_search_paths : [ fs:: path ] ,
41
39
mutable next_crate_num: ast:: crate_num } ;
42
40
43
41
fn visit_view_item ( e : env , i : @ast:: view_item ) {
@@ -109,7 +107,7 @@ fn default_native_lib_naming(sess: session::session, static: bool) ->
109
107
}
110
108
111
109
fn find_library_crate ( sess : session:: session , ident : ast:: ident ,
112
- metas : [ @ast:: meta_item ] , library_search_paths : [ str ] )
110
+ metas : [ @ast:: meta_item ] )
113
111
-> option:: t < { ident: str , data : @[ u8 ] } > {
114
112
115
113
attr:: require_unique_names ( sess, metas) ;
@@ -132,10 +130,12 @@ fn find_library_crate(sess: session::session, ident: ast::ident,
132
130
133
131
let nn = default_native_lib_naming ( sess, sess. get_opts ( ) . static ) ;
134
132
let x =
135
- find_library_crate_aux ( nn, crate_name, metas, library_search_paths) ;
133
+ find_library_crate_aux ( nn, crate_name, metas,
134
+ sess. filesearch ( ) . lib_search_paths ( ) ) ;
136
135
if x != none || sess. get_opts ( ) . static { ret x; }
137
136
let nn2 = default_native_lib_naming ( sess, true ) ;
138
- ret find_library_crate_aux ( nn2, crate_name, metas, library_search_paths) ;
137
+ ret find_library_crate_aux ( nn2, crate_name, metas,
138
+ sess. filesearch ( ) . lib_search_paths ( ) ) ;
139
139
}
140
140
141
141
fn find_library_crate_aux ( nn : { prefix : str , suffix : str } , crate_name : str ,
@@ -198,11 +198,11 @@ fn get_metadata_section(filename: str) -> option::t<@[u8]> {
198
198
}
199
199
200
200
fn load_library_crate ( sess : session:: session , span : span , ident : ast:: ident ,
201
- metas : [ @ast:: meta_item ] , library_search_paths : [ str ] )
201
+ metas : [ @ast:: meta_item ] )
202
202
-> { ident: str , data: @[ u8] } {
203
203
204
204
205
- alt find_library_crate ( sess, ident, metas, library_search_paths ) {
205
+ alt find_library_crate ( sess, ident, metas) {
206
206
some ( t) { ret t; }
207
207
none. {
208
208
sess . span_fatal ( span, #fmt[ "can't find crate for '%s'" , ident] ) ;
@@ -214,8 +214,7 @@ fn resolve_crate(e: env, ident: ast::ident, metas: [@ast::meta_item],
214
214
span : span ) -> ast:: crate_num {
215
215
if !e. crate_cache . contains_key ( ident) {
216
216
let cinfo =
217
- load_library_crate ( e. sess , span, ident, metas,
218
- e. library_search_paths ) ;
217
+ load_library_crate ( e. sess , span, ident, metas) ;
219
218
220
219
let cfilename = cinfo. ident ;
221
220
let cdata = cinfo. data ;
0 commit comments