@@ -10,6 +10,7 @@ use rustc_data_structures::fx::FxHashSet;
10
10
use rustc_data_structures:: svh:: Svh ;
11
11
use rustc_data_structures:: sync:: { FreezeReadGuard , FreezeWriteGuard } ;
12
12
use rustc_expand:: base:: SyntaxExtension ;
13
+ use rustc_fs_util:: try_canonicalize;
13
14
use rustc_hir:: def_id:: { CrateNum , LocalDefId , StableCrateId , StableCrateIdMap , LOCAL_CRATE } ;
14
15
use rustc_hir:: definitions:: Definitions ;
15
16
use rustc_index:: IndexVec ;
@@ -31,7 +32,7 @@ use std::error::Error;
31
32
use std:: ops:: Fn ;
32
33
use std:: path:: Path ;
33
34
use std:: time:: Duration ;
34
- use std:: { cmp, env , iter} ;
35
+ use std:: { cmp, iter} ;
35
36
36
37
pub struct CStore {
37
38
metadata_loader : Box < MetadataLoaderDyn > ,
@@ -676,8 +677,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
676
677
path : & Path ,
677
678
stable_crate_id : StableCrateId ,
678
679
) -> Result < & ' static [ ProcMacro ] , CrateError > {
679
- // Make sure the path contains a / or the linker will search for it.
680
- let path = env:: current_dir ( ) . unwrap ( ) . join ( path) ;
680
+ let path = try_canonicalize ( path) . unwrap ( ) ;
681
681
let lib = load_dylib ( & path, 5 ) . map_err ( |err| CrateError :: DlOpen ( err) ) ?;
682
682
683
683
let sym_name = self . sess . generate_proc_macro_decls_symbol ( stable_crate_id) ;
0 commit comments