diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index 8937ea8561b..9674579e249 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -5,8 +5,6 @@ authors = ["Alex Crichton "] license = "MIT OR Apache-2.0" edition = "2018" -build = "build.rs" - [lib] doctest = false diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index 0654e559970..6f692e21bf1 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -727,22 +727,15 @@ impl<'cfg> RustcTargetData<'cfg> { })); for kind in all_kinds { if let CompileKind::Target(target) = kind { - match res.target_config.entry(target) { - std::collections::hash_map::Entry::Occupied(_) => (), - std::collections::hash_map::Entry::Vacant(place) => { - place.insert(res.config.target_cfg_triple(target.short_name())?); - } + if !res.target_config.contains_key(&target) { + res.target_config + .insert(target, res.config.target_cfg_triple(target.short_name())?); } - match res.target_info.entry(target) { - std::collections::hash_map::Entry::Occupied(_) => (), - std::collections::hash_map::Entry::Vacant(place) => { - place.insert(TargetInfo::new( - res.config, - &res.requested_kinds, - &res.rustc, - kind, - )?); - } + if !res.target_info.contains_key(&target) { + res.target_info.insert( + target, + TargetInfo::new(res.config, &res.requested_kinds, &res.rustc, kind)?, + ); } } } diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index a84a2ca4fcb..28c313baff9 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -1322,7 +1322,7 @@ impl TomlManifest { .default_target .as_ref() .map(|t| CompileTarget::new(&*t)) - .transpose()? // TODO: anyhow::Context isn't imported yet so I guess .context() isn't the right way to do it? + .transpose()? .map(CompileKind::Target); let forced_kind = project .forced_target