@@ -85,9 +85,8 @@ impl Sysroot {
8585 " try running `rustup component add rust-src` to possible fix this"
8686 } ;
8787 Some ( format ! (
88- "could not find libcore in loaded sysroot at `{}`{}" ,
89- self . src_root. as_path( ) . display( ) ,
90- var_note,
88+ "could not find libcore in loaded sysroot at `{}`{var_note}" ,
89+ self . src_root. as_path( ) ,
9190 ) )
9291 } else {
9392 None
@@ -99,7 +98,7 @@ impl Sysroot {
9998impl Sysroot {
10099 /// Attempts to discover the toolchain's sysroot from the given `dir`.
101100 pub fn discover ( dir : & AbsPath , extra_env : & FxHashMap < String , String > ) -> Result < Sysroot > {
102- tracing:: debug!( "discovering sysroot for {}" , dir . display ( ) ) ;
101+ tracing:: debug!( "discovering sysroot for {dir}" ) ;
103102 let sysroot_dir = discover_sysroot_dir ( dir, extra_env) ?;
104103 let sysroot_src_dir =
105104 discover_sysroot_src_dir_or_add_component ( & sysroot_dir, dir, extra_env) ?;
@@ -111,7 +110,7 @@ impl Sysroot {
111110 extra_env : & FxHashMap < String , String > ,
112111 src : AbsPathBuf ,
113112 ) -> Result < Sysroot > {
114- tracing:: debug!( "discovering sysroot for {}" , current_dir . display ( ) ) ;
113+ tracing:: debug!( "discovering sysroot for {current_dir}" ) ;
115114 let sysroot_dir = discover_sysroot_dir ( current_dir, extra_env) ?;
116115 Ok ( Sysroot :: load ( sysroot_dir, src) )
117116 }
@@ -122,7 +121,7 @@ impl Sysroot {
122121
123122 pub fn with_sysroot_dir ( sysroot_dir : AbsPathBuf ) -> Result < Sysroot > {
124123 let sysroot_src_dir = discover_sysroot_src_dir ( & sysroot_dir) . ok_or_else ( || {
125- format_err ! ( "can't load standard library from sysroot path {}" , sysroot_dir . display ( ) )
124+ format_err ! ( "can't load standard library from sysroot path {sysroot_dir}" )
126125 } ) ?;
127126 Ok ( Sysroot :: load ( sysroot_dir, sysroot_src_dir) )
128127 }
@@ -220,10 +219,10 @@ fn discover_sysroot_src_dir(sysroot_path: &AbsPathBuf) -> Option<AbsPathBuf> {
220219 if let Ok ( path) = AbsPathBuf :: try_from ( path. as_str ( ) ) {
221220 let core = path. join ( "core" ) ;
222221 if fs:: metadata ( & core) . is_ok ( ) {
223- tracing:: debug!( "Discovered sysroot by RUST_SRC_PATH: {}" , path . display ( ) ) ;
222+ tracing:: debug!( "Discovered sysroot by RUST_SRC_PATH: {path}" ) ;
224223 return Some ( path) ;
225224 }
226- tracing:: debug!( "RUST_SRC_PATH is set, but is invalid (no core: {:?}), ignoring" , core ) ;
225+ tracing:: debug!( "RUST_SRC_PATH is set, but is invalid (no core: {core :?}), ignoring" ) ;
227226 } else {
228227 tracing:: debug!( "RUST_SRC_PATH is set, but is invalid, ignoring" ) ;
229228 }
@@ -250,18 +249,17 @@ fn discover_sysroot_src_dir_or_add_component(
250249 format_err ! (
251250 "\
252251 can't load standard library from sysroot
253- {}
252+ {sysroot_path }
254253(discovered via `rustc --print sysroot`)
255254try installing the Rust source the same way you installed rustc" ,
256- sysroot_path. display( ) ,
257255 )
258256 } )
259257}
260258
261259fn get_rustc_src ( sysroot_path : & AbsPath ) -> Option < ManifestPath > {
262260 let rustc_src = sysroot_path. join ( "lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml" ) ;
263261 let rustc_src = ManifestPath :: try_from ( rustc_src) . ok ( ) ?;
264- tracing:: debug!( "checking for rustc source code: {}" , rustc_src . display ( ) ) ;
262+ tracing:: debug!( "checking for rustc source code: {rustc_src}" ) ;
265263 if fs:: metadata ( & rustc_src) . is_ok ( ) {
266264 Some ( rustc_src)
267265 } else {
@@ -271,7 +269,7 @@ fn get_rustc_src(sysroot_path: &AbsPath) -> Option<ManifestPath> {
271269
272270fn get_rust_src ( sysroot_path : & AbsPath ) -> Option < AbsPathBuf > {
273271 let rust_src = sysroot_path. join ( "lib/rustlib/src/rust/library" ) ;
274- tracing:: debug!( "checking sysroot library: {}" , rust_src . display ( ) ) ;
272+ tracing:: debug!( "checking sysroot library: {rust_src}" ) ;
275273 if fs:: metadata ( & rust_src) . is_ok ( ) {
276274 Some ( rust_src)
277275 } else {
0 commit comments