From 88c7355cb6aff50a64c699c0d19442ce672bc59e Mon Sep 17 00:00:00 2001 From: messense Date: Sun, 19 Jun 2022 13:32:40 +0800 Subject: [PATCH] Don't warn if packages not listed in `cargo metadata` are coming from Rust sysroot --- src/compile.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/compile.rs b/src/compile.rs index 170bfb5da..df41118a7 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -399,11 +399,17 @@ fn compile_target( let crate_name = match package_in_metadata { Some(package) => &package.name, None => { - // This is a spurious error I don't really understand - println!( - "⚠️ Warning: The package {} wasn't listed in `cargo metadata`", - artifact.package_id - ); + let package_id = &artifact.package_id; + // Ignore the package if it's coming from Rust sysroot when compiling with `-Zbuild-std` + if !package_id.repr.contains("rustup") + && !package_id.repr.contains("rustlib") + { + // This is a spurious error I don't really understand + println!( + "⚠️ Warning: The package {} wasn't listed in `cargo metadata`", + package_id + ); + } continue; } };