Skip to content

Commit

Permalink
handle review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog committed Apr 24, 2021
1 parent 2bef76a commit 731d881
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 0 additions & 2 deletions crates/cargo-test-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
edition = "2018"

build = "build.rs"

[lib]
doctest = false

Expand Down
23 changes: 8 additions & 15 deletions src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?,
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 731d881

Please sign in to comment.