We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b0c39e commit 6cbd2d3Copy full SHA for 6cbd2d3
compiler/rustc_errors/src/emitter.rs
@@ -3569,10 +3569,17 @@ fn is_external_library(sm: &SourceMap, span: Span) -> bool {
3569
}
3570
};
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
let registry_path = cargo_home.join("registry").join("src");
3578
let toolchain_path = rustup_home.join("toolchains");
3579
- path.starts_with(®istry_path) || path.starts_with(&toolchain_path)
3580
+ path.starts_with(®istry_path)
3581
+ || path.starts_with(&toolchain_path)
3582
+ || sysroot.as_ref().map_or(false, |sr| path.starts_with(sr))
3583
} else {
3584
false
3585
0 commit comments