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