@@ -22,6 +22,7 @@ use syntax::codemap::Span;
2222use syntax:: diagnostic:: SpanHandler ;
2323use syntax:: crateid:: CrateId ;
2424use syntax:: attr:: AttrMetaMethods ;
25+ use util:: fs;
2526
2627use std:: c_str:: ToCStr ;
2728use std:: cast;
@@ -107,18 +108,6 @@ impl CratePaths {
107108 }
108109}
109110
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-
122111impl < ' a > Context < ' a > {
123112 pub fn maybe_load_library_crate ( & mut self ) -> Option < Library > {
124113 self . find_library_crate ( )
@@ -209,7 +198,6 @@ impl<'a> Context<'a> {
209198 None => return FileDoesntMatch ,
210199 Some ( file) => file,
211200 } ;
212- info ! ( "file: {}" , file) ;
213201 if file. starts_with ( rlib_prefix) && file. ends_with ( ".rlib" ) {
214202 info ! ( "rlib candidate: {}" , path. display( ) ) ;
215203 match self . try_match ( file, rlib_prefix, ".rlib" ) {
@@ -219,7 +207,7 @@ impl<'a> Context<'a> {
219207 ( HashSet :: new ( ) , HashSet :: new ( ) )
220208 } ) ;
221209 let ( ref mut rlibs, _) = * slot;
222- rlibs. insert ( realpath ( path) ) ;
210+ rlibs. insert ( fs :: realpath ( path) . unwrap ( ) ) ;
223211 FileMatches
224212 }
225213 None => {
@@ -236,7 +224,7 @@ impl<'a> Context<'a> {
236224 ( HashSet :: new ( ) , HashSet :: new ( ) )
237225 } ) ;
238226 let ( _, ref mut dylibs) = * slot;
239- dylibs. insert ( realpath ( path) ) ;
227+ dylibs. insert ( fs :: realpath ( path) . unwrap ( ) ) ;
240228 FileMatches
241229 }
242230 None => {
0 commit comments