Skip to content

Commit f4c16ec

Browse files
committed
test(build-std): move away from panic_immediate_abort
The test exercises a regression of extra `-Zbuild-std-features` overriding the entire default-features set. However, after rust-lang/rust 146317 panic_immediate_abort became a codegen flag not a Cargo feature anymore. We pick another `optimize_for_size` feature flag to ensure the regression case is still covered. To verify `optimize_for_size` actually triggers the regression, git revert f004691 and changes to `-Zbuild-std-features=optimize_for_size`. Alternatively, we can just drop this test.
1 parent b7e5fac commit f4c16ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/build-std/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ fn test_proc_macro() {
396396
}
397397

398398
#[cargo_test(build_std_real)]
399-
fn test_panic_abort() {
399+
fn default_features_still_included_with_extra_build_std_features() {
400+
// This is a regression test to ensure when adding extra `build-std-features`,
401+
// the default feature set is still respected and included.
400402
// See rust-lang/cargo#14935
401403
let p = project()
402404
.file(
@@ -413,7 +415,7 @@ fn test_panic_abort() {
413415
p.cargo("check")
414416
.build_std_arg("std,panic_abort")
415417
.env("RUSTFLAGS", "-C panic=abort")
416-
.arg("-Zbuild-std-features=panic_immediate_abort")
418+
.arg("-Zbuild-std-features=optimize_for_size")
417419
.run();
418420
}
419421

0 commit comments

Comments
 (0)