Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused profile support for -Zpanic-abort-tests #10495

Merged
merged 1 commit into from
Mar 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions src/cargo/core/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,24 +234,14 @@ impl Profiles {
unit_for: UnitFor,
kind: CompileKind,
) -> Profile {
let (profile_name, inherits) = (self.requested_profile, None);
let maker = self.get_profile_maker(profile_name).unwrap();
let maker = self.get_profile_maker(self.requested_profile).unwrap();
let mut profile = maker.get_profile(Some(pkg_id), is_member, unit_for.is_for_host());

// Dealing with `panic=abort` and `panic=unwind` requires some special
// treatment. Be sure to process all the various options here.
match unit_for.panic_setting() {
PanicSetting::AlwaysUnwind => profile.panic = PanicStrategy::Unwind,
PanicSetting::ReadProfile => {}
PanicSetting::Inherit => {
if let Some(inherits) = inherits {
// TODO: Fixme, broken with named profiles.
let maker = self.get_profile_maker(inherits).unwrap();
profile.panic = maker
.get_profile(Some(pkg_id), is_member, unit_for.is_for_host())
.panic;
}
}
}

// Default macOS debug information to being stored in the "unpacked"
Expand Down Expand Up @@ -285,7 +275,7 @@ impl Profiles {
if !is_local {
profile.incremental = false;
}
profile.name = profile_name;
profile.name = self.requested_profile;
profile
}

Expand Down Expand Up @@ -840,10 +830,6 @@ enum PanicSetting {
/// Indicates that this unit will read its `profile` setting and use
/// whatever is configured there.
ReadProfile,

/// This unit will ignore its `panic` setting in its profile and will
/// instead inherit it from the `dev` or `release` profile, as appropriate.
Inherit,
}

impl UnitFor {
Expand Down Expand Up @@ -909,7 +895,7 @@ impl UnitFor {
// (basically avoid recompiles) but historical defaults required
// that we always unwound.
panic_setting: if config.cli_unstable().panic_abort_tests {
PanicSetting::Inherit
PanicSetting::ReadProfile
} else {
PanicSetting::AlwaysUnwind
},
Expand Down