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 {
3569
3569
}
3570
3570
} ;
3571
3571
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) ;
3572
3578
let registry_path = cargo_home. join ( "registry" ) . join ( "src" ) ;
3573
3579
let toolchain_path = rustup_home. join ( "toolchains" ) ;
3574
3580
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) )
3576
3584
} else {
3577
3585
false
3578
3586
}
You can’t perform that action at this time.
0 commit comments