@@ -312,8 +312,8 @@ impl Sysroot {
312
312
RustLibSrcWorkspace :: Empty => true ,
313
313
} ;
314
314
if !has_core {
315
- let var_note = if env:: var_os ( "rust_lib_src_PATH " ) . is_some ( ) {
316
- " (env var `rust_lib_src_PATH ` is set and may be incorrect, try unsetting it)"
315
+ let var_note = if env:: var_os ( "RUST_SRC_PATH " ) . is_some ( ) {
316
+ " (env var `RUST_SRC_PATH ` is set and may be incorrect, try unsetting it)"
317
317
} else {
318
318
", try running `rustup component add rust-src` to possibly fix this"
319
319
} ;
@@ -422,18 +422,16 @@ fn discover_sysroot_dir(
422
422
}
423
423
424
424
fn discover_rust_lib_src_dir ( sysroot_path : & AbsPathBuf ) -> Option < AbsPathBuf > {
425
- if let Ok ( path) = env:: var ( "rust_lib_src_PATH " ) {
425
+ if let Ok ( path) = env:: var ( "RUST_SRC_PATH " ) {
426
426
if let Ok ( path) = AbsPathBuf :: try_from ( path. as_str ( ) ) {
427
427
let core = path. join ( "core" ) ;
428
428
if fs:: metadata ( & core) . is_ok ( ) {
429
- tracing:: debug!( "Discovered sysroot by rust_lib_src_PATH : {path}" ) ;
429
+ tracing:: debug!( "Discovered sysroot by RUST_SRC_PATH : {path}" ) ;
430
430
return Some ( path) ;
431
431
}
432
- tracing:: debug!(
433
- "rust_lib_src_PATH is set, but is invalid (no core: {core:?}), ignoring"
434
- ) ;
432
+ tracing:: debug!( "RUST_SRC_PATH is set, but is invalid (no core: {core:?}), ignoring" ) ;
435
433
} else {
436
- tracing:: debug!( "rust_lib_src_PATH is set, but is invalid, ignoring" ) ;
434
+ tracing:: debug!( "RUST_SRC_PATH is set, but is invalid, ignoring" ) ;
437
435
}
438
436
}
439
437
0 commit comments