@@ -22,6 +22,7 @@ use syntax::codemap::Span;
22
22
use syntax:: diagnostic:: SpanHandler ;
23
23
use syntax:: crateid:: CrateId ;
24
24
use syntax:: attr:: AttrMetaMethods ;
25
+ use util:: fs;
25
26
26
27
use std:: c_str:: ToCStr ;
27
28
use std:: cast;
@@ -107,18 +108,6 @@ impl CratePaths {
107
108
}
108
109
}
109
110
110
- // FIXME(#11857) this should be a "real" realpath
111
- fn realpath ( p : & Path ) -> Path {
112
- use std:: os;
113
- use std:: io:: fs;
114
-
115
- let path = os:: make_absolute ( p) ;
116
- match fs:: readlink ( & path) {
117
- Ok ( p) => p,
118
- Err ( ..) => path
119
- }
120
- }
121
-
122
111
impl < ' a > Context < ' a > {
123
112
pub fn maybe_load_library_crate ( & mut self ) -> Option < Library > {
124
113
self . find_library_crate ( )
@@ -209,7 +198,6 @@ impl<'a> Context<'a> {
209
198
None => return FileDoesntMatch ,
210
199
Some ( file) => file,
211
200
} ;
212
- info ! ( "file: {}" , file) ;
213
201
if file. starts_with ( rlib_prefix) && file. ends_with ( ".rlib" ) {
214
202
info ! ( "rlib candidate: {}" , path. display( ) ) ;
215
203
match self . try_match ( file, rlib_prefix, ".rlib" ) {
@@ -219,7 +207,7 @@ impl<'a> Context<'a> {
219
207
( HashSet :: new ( ) , HashSet :: new ( ) )
220
208
} ) ;
221
209
let ( ref mut rlibs, _) = * slot;
222
- rlibs. insert ( realpath ( path) ) ;
210
+ rlibs. insert ( fs :: realpath ( path) . unwrap ( ) ) ;
223
211
FileMatches
224
212
}
225
213
None => {
@@ -236,7 +224,7 @@ impl<'a> Context<'a> {
236
224
( HashSet :: new ( ) , HashSet :: new ( ) )
237
225
} ) ;
238
226
let ( _, ref mut dylibs) = * slot;
239
- dylibs. insert ( realpath ( path) ) ;
227
+ dylibs. insert ( fs :: realpath ( path) . unwrap ( ) ) ;
240
228
FileMatches
241
229
}
242
230
None => {
0 commit comments