From 84331fcf71a509677390b3497608cb051837f2ae Mon Sep 17 00:00:00 2001 From: Dan Aloni Date: Thu, 1 Aug 2019 11:45:43 +0300 Subject: [PATCH] profiles: allow to specify overrides other than for 'dev' and 'release' --- src/cargo/util/toml/mod.rs | 13 ---------- tests/testsuite/profile_overrides.rs | 36 ---------------------------- 2 files changed, 49 deletions(-) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 97629a9e6..7ece62182 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -461,19 +461,6 @@ impl TomlProfile { } } - match name { - "dev" | "release" => {} - _ => { - if self.overrides.is_some() || self.build_override.is_some() { - bail!( - "Profile overrides may only be specified for \ - `dev` or `release` profile, not `{}`.", - name - ); - } - } - } - match name { "doc" => { warnings.push("profile `doc` is deprecated and has no effect".to_string()); diff --git a/tests/testsuite/profile_overrides.rs b/tests/testsuite/profile_overrides.rs index 17b3c25c1..a550e50d1 100644 --- a/tests/testsuite/profile_overrides.rs +++ b/tests/testsuite/profile_overrides.rs @@ -149,42 +149,6 @@ fn profile_override_warnings() { .run(); } -#[cargo_test] -fn profile_override_dev_release_only() { - let p = project() - .file( - "Cargo.toml", - r#" - cargo-features = ["profile-overrides"] - - [package] - name = "foo" - version = "0.0.1" - - [dependencies] - bar = {path = "bar"} - - [profile.test.overrides.bar] - opt-level = 3 - "#, - ) - .file("src/lib.rs", "") - .file("bar/Cargo.toml", &basic_lib_manifest("bar")) - .file("bar/src/lib.rs", "") - .build(); - - p.cargo("build") - .masquerade_as_nightly_cargo() - .with_status(101) - .with_stderr_contains( - "\ -Caused by: - Profile overrides may only be specified for `dev` or `release` profile, not `test`. -", - ) - .run(); -} - #[cargo_test] fn profile_override_bad_settings() { let bad_values = [ -- 2.39.5