@@ -123,8 +123,8 @@ fn get_metadata_section(str filename) -> option::t[vec[u8]] {
123
123
ret option:: none[ vec[ u8] ] ;
124
124
}
125
125
126
- fn load_library_crate ( & session:: session sess, int cnum , & ast :: ident ident ,
127
- & vec[ @ast:: meta_item] metas ,
126
+ fn load_library_crate ( & session:: session sess, common :: span span , int cnum ,
127
+ & ast :: ident ident , vec[ @ast:: meta_item] metas,
128
128
& vec[ str] library_search_paths ) {
129
129
alt ( find_library_crate ( sess, ident, metas, library_search_paths) ) {
130
130
case ( some ( ?t) ) {
@@ -134,8 +134,7 @@ fn load_library_crate(&session::session sess, int cnum, &ast::ident ident,
134
134
}
135
135
case ( _) { }
136
136
}
137
- log_err #fmt( "can't find crate for '%s'" , ident) ;
138
- fail;
137
+ sess. span_fatal ( span, #fmt ( "can't find crate for '%s'" , ident) ) ;
139
138
}
140
139
141
140
type env =
@@ -151,8 +150,8 @@ fn visit_view_item(env e, &@ast::view_item i) {
151
150
auto cnum;
152
151
if ( !e. crate_cache . contains_key ( ident) ) {
153
152
cnum = e. next_crate_num ;
154
- load_library_crate ( e. sess , cnum , ident , meta_items ,
155
- e. library_search_paths ) ;
153
+ load_library_crate ( e. sess , i . span , cnum , ident ,
154
+ meta_items , e. library_search_paths ) ;
156
155
e. crate_cache . insert ( ident, e. next_crate_num ) ;
157
156
e. next_crate_num += 1 ;
158
157
} else { cnum = e. crate_cache . get ( ident) ; }
0 commit comments