From e389ff731a9813304b299ccdddfd425c8c27fd13 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 21 Mar 2022 14:25:42 -0700 Subject: [PATCH] Remove unused profile support for -Zpanic-abort-tests --- src/cargo/core/profiles.rs | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/cargo/core/profiles.rs b/src/cargo/core/profiles.rs index fe326688f54..75d93f50736 100644 --- a/src/cargo/core/profiles.rs +++ b/src/cargo/core/profiles.rs @@ -234,8 +234,7 @@ 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 @@ -243,15 +242,6 @@ impl Profiles { 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" @@ -285,7 +275,7 @@ impl Profiles { if !is_local { profile.incremental = false; } - profile.name = profile_name; + profile.name = self.requested_profile; profile } @@ -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 { @@ -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 },