From 99261fb06c5d11b0f83ee5ccdb1cd1bd041d5345 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Tue, 15 Sep 2026 11:22:55 +0000 Subject: [PATCH] Add must_use lint to ExitCode --- library/std/src/process.rs | 1 + tests/ui/attributes/reexport-test-harness-entry-point.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 6414a235698b8..20ea03d36eb0e 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -2206,6 +2206,7 @@ impl crate::error::Error for ExitStatusError {} /// ``` #[derive(Clone, Copy, Debug, PartialEq)] #[stable(feature = "process_exitcode", since = "1.61.0")] +#[must_use] pub struct ExitCode(imp::ExitCode); #[stable(feature = "process_exitcode", since = "1.61.0")] diff --git a/tests/ui/attributes/reexport-test-harness-entry-point.rs b/tests/ui/attributes/reexport-test-harness-entry-point.rs index 4de308dafe4a7..ca942e90b04d4 100644 --- a/tests/ui/attributes/reexport-test-harness-entry-point.rs +++ b/tests/ui/attributes/reexport-test-harness-entry-point.rs @@ -11,5 +11,5 @@ fn _unused() { // should resolve to the entry point function the --test harness // creates. - test_main(); + let _ = test_main(); }