Skip to content

Commit 423808f

Browse files
committed
Make sure fmt-write-bloat doesn't vacuously pass
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.
1 parent 558d253 commit 423808f

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)