File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 11#![ allow( rustc:: bad_opt_access) ]
2- use std:: collections:: { BTreeMap , BTreeSet } ;
2+ use std:: collections:: BTreeMap ;
33use std:: num:: NonZero ;
4- use std:: path:: { Path , PathBuf } ;
4+ use std:: path:: PathBuf ;
55use std:: sync:: atomic:: AtomicBool ;
66
77use rustc_abi:: Align ;
8989 S : Into < String > ,
9090 I : IntoIterator < Item = S > ,
9191{
92- let locations: BTreeSet < CanonicalizedPath > =
93- locations. into_iter ( ) . map ( |s| CanonicalizedPath :: new ( Path :: new ( & s. into ( ) ) ) ) . collect ( ) ;
92+ let locations =
93+ locations. into_iter ( ) . map ( |s| CanonicalizedPath :: new ( PathBuf :: from ( s. into ( ) ) ) ) . collect ( ) ;
9494
9595 ExternEntry {
9696 location : ExternLocation :: ExactPaths ( locations) ,
Original file line number Diff line number Diff line change @@ -2323,14 +2323,13 @@ pub fn parse_externs(
23232323 let ExternOpt { crate_name : name, path, options } =
23242324 split_extern_opt ( early_dcx, unstable_opts, & arg) . unwrap_or_else ( |e| e. emit ( ) ) ;
23252325
2326- let path = path. map ( |p| CanonicalizedPath :: new ( p. as_path ( ) ) ) ;
2327-
23282326 let entry = externs. entry ( name. to_owned ( ) ) ;
23292327
23302328 use std:: collections:: btree_map:: Entry ;
23312329
23322330 let entry = if let Some ( path) = path {
23332331 // --extern prelude_name=some_file.rlib
2332+ let path = CanonicalizedPath :: new ( path) ;
23342333 match entry {
23352334 Entry :: Vacant ( vacant) => {
23362335 let files = BTreeSet :: from_iter ( iter:: once ( path) ) ;
Original file line number Diff line number Diff line change 1- use std:: path:: { Path , PathBuf } ;
1+ use std:: path:: PathBuf ;
22use std:: sync:: OnceLock ;
33
44use rustc_data_structures:: profiling:: VerboseTimingGuard ;
@@ -104,8 +104,8 @@ pub struct CanonicalizedPath {
104104}
105105
106106impl CanonicalizedPath {
107- pub fn new ( path : & Path ) -> Self {
108- Self { original : path . to_owned ( ) , canonicalized : try_canonicalize ( path) . ok ( ) }
107+ pub fn new ( path : PathBuf ) -> Self {
108+ Self { canonicalized : try_canonicalize ( & path) . ok ( ) , original : path }
109109 }
110110
111111 pub fn canonicalized ( & self ) -> & PathBuf {
You can’t perform that action at this time.
0 commit comments