Skip to content

Commit 9306675

Browse files
Auto merge of #143669 - jieyouxu:fmt-write-bloat, r=<try>
Make sure `fmt-write-bloat` doesn't vacuously pass on no symbols Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion. Fix this by checking we at least observe the `main` symbol which is always expected to be present. Noticed in #142841 (comment). r? `@ChrisDenton` try-job: x86_64-msvc-*
2 parents d350797 + 5cef54f commit 9306675

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/run-make/fmt-write-bloat/rmake.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ fn main() {
3131
// otherwise, add them to the list of symbols to deny.
3232
panic_syms.extend_from_slice(&["panicking", "panic_fmt", "pad_integral", "Display"]);
3333
}
34+
// Make sure we at least have the `main` symbol itself, otherwise even no symbols can trivially
35+
// satisfy the "no panic symbol" assertion.
36+
assert!(any_symbol_contains(bin_name("main"), &["main"]));
3437
assert!(!any_symbol_contains(bin_name("main"), &panic_syms));
3538
}

0 commit comments

Comments
 (0)