Skip to content

Commit 0468dd5

Browse files
committed
remove warning "panic setting is ignored for test profile"
1 parent ce51a91 commit 0468dd5

File tree

3 files changed

+3
-41
lines changed

3 files changed

+3
-41
lines changed

src/cargo/util/toml/mod.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -633,16 +633,8 @@ impl TomlProfile {
633633
);
634634
}
635635

636-
match name {
637-
"doc" => {
638-
warnings.push("profile `doc` is deprecated and has no effect".to_string());
639-
}
640-
"test" | "bench" => {
641-
if self.panic.is_some() {
642-
warnings.push(format!("`panic` setting is ignored for `{}` profile", name))
643-
}
644-
}
645-
_ => {}
636+
if name == "doc" {
637+
warnings.push("profile `doc` is deprecated and has no effect".to_string());
646638
}
647639

648640
if let Some(panic) = &self.panic {

tests/testsuite/profiles.rs

-30
Original file line numberDiff line numberDiff line change
@@ -353,36 +353,6 @@ must be a boolean (`true`/`false`) or a string (`\"thin\"`/`\"fat\"`/`\"off\"`)
353353
.run();
354354
}
355355

356-
#[cargo_test]
357-
fn profile_panic_test_bench() {
358-
let p = project()
359-
.file(
360-
"Cargo.toml",
361-
r#"
362-
[package]
363-
name = "foo"
364-
version = "0.0.1"
365-
366-
[profile.test]
367-
panic = "abort"
368-
369-
[profile.bench]
370-
panic = "abort"
371-
"#,
372-
)
373-
.file("src/lib.rs", "")
374-
.build();
375-
376-
p.cargo("build")
377-
.with_stderr_contains(
378-
"\
379-
[WARNING] `panic` setting is ignored for `bench` profile
380-
[WARNING] `panic` setting is ignored for `test` profile
381-
",
382-
)
383-
.run();
384-
}
385-
386356
/// Custom harness can have `-C panic="…"` passed in.
387357
#[cargo_test]
388358
fn profile_panic_test_with_custom_harness() {

tests/testsuite/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4472,7 +4472,7 @@ fn panic_abort_only_test() {
44724472
.build();
44734473

44744474
p.cargo("test -Z panic-abort-tests -v")
4475-
.with_stderr_contains("warning: `panic` setting is ignored for `test` profile")
4475+
.with_stderr_contains("[..]--crate-name foo [..]-C panic=abort[..]")
44764476
.masquerade_as_nightly_cargo(&["panic-abort-tests"])
44774477
.run();
44784478
}

0 commit comments

Comments
 (0)