File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3569,10 +3569,18 @@ fn is_external_library(sm: &SourceMap, span: Span) -> bool {
35693569 }
35703570 } ;
35713571
3572+ let sysroot = match std:: env:: var ( "RUSTC_SYSROOT" ) {
3573+ Ok ( dir) => Some ( std:: path:: PathBuf :: from ( dir) ) ,
3574+ Err ( _) => None ,
3575+ } ;
3576+
3577+ println ! ( "sysroot: {:?}" , sysroot) ;
35723578 let registry_path = cargo_home. join ( "registry" ) . join ( "src" ) ;
35733579 let toolchain_path = rustup_home. join ( "toolchains" ) ;
35743580
3575- path. starts_with ( & registry_path) || path. starts_with ( & toolchain_path)
3581+ path. starts_with ( & registry_path)
3582+ || path. starts_with ( & toolchain_path)
3583+ || sysroot. as_ref ( ) . map_or ( false , |sr| path. starts_with ( sr) )
35763584 } else {
35773585 false
35783586 }
You can’t perform that action at this time.
0 commit comments