File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,11 @@ impl<'gctx> Compilation<'gctx> {
323323
324324        let  dylib_path = paths:: dylib_path ( ) ; 
325325        let  dylib_path_is_empty = dylib_path. is_empty ( ) ; 
326-         search_path. extend ( dylib_path. into_iter ( ) ) ; 
326+         if  dylib_path. starts_with ( & search_path)  { 
327+             search_path = dylib_path; 
328+         }  else  { 
329+             search_path. extend ( dylib_path. into_iter ( ) ) ; 
330+         } 
327331        if  cfg ! ( target_os = "macos" )  && dylib_path_is_empty { 
328332            // These are the defaults when DYLD_FALLBACK_LIBRARY_PATH isn't 
329333            // set or set to an empty string. Since Cargo is explicitly setting 
Original file line number Diff line number Diff line change @@ -2173,9 +2173,8 @@ fn issue_14194_deduplicate_library_path_env_var() {
21732173                            let lib_path = std::env::var("{}").unwrap(); 
21742174                            let paths: Vec<_> = std::env::split_paths(&lib_path).collect(); 
21752175                            if paths.len() > 1 {{ 
2176-                                 // The first path will be prepended to the search path in the next run 
21772176                                let first = &paths[0]; 
2178-                                 assert!(paths[1..].contains(&first)); 
2177+                                 assert!(! paths[1..].contains(&first)); 
21792178                            }} 
21802179                            return;  
21812180                        }}  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments