about summary refs log tree commit diff
path: root/tests/ui/panic-handler/panic-handler-wrong-location.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-25 16:42:36 +0000
committerbors <bors@rust-lang.org>2025-03-25 16:42:36 +0000
commit40507bded561ca6d28f3e187aed8317bb81ce9e2 (patch)
tree645b301936cf53db0db5bb60f45e9ae496faf99b /tests/ui/panic-handler/panic-handler-wrong-location.rs
parent48994b1674b3212d27b5e83841c0966bc2b4be43 (diff)
parent8d5109aa6ea1b54a560774eb95ba7c1b8d404faa (diff)
downloadrust-40507bded561ca6d28f3e187aed8317bb81ce9e2.tar.gz
rust-40507bded561ca6d28f3e187aed8317bb81ce9e2.zip
Auto merge of #138865 - petrochenkov:errwhere, r=jieyouxu
compiletest: Support matching on diagnostics without a span

Using `//~? ERROR my message` on any line of the test.

The new checks are exhaustive, like all other `//~` checks, and unlike the `error-pattern` directive that is sometimes used now to check for span-less diagnostics.

This will allow to eliminate most on `error-pattern` directives in compile-fail tests (except those that are intentionally imprecise due to platform-specific diagnostics).
I didn't migrate any of `error-pattern`s in this PR though, except those where the migration was necessary for the tests to pass.
Diffstat (limited to 'tests/ui/panic-handler/panic-handler-wrong-location.rs')
-rw-r--r--tests/ui/panic-handler/panic-handler-wrong-location.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/ui/panic-handler/panic-handler-wrong-location.rs b/tests/ui/panic-handler/panic-handler-wrong-location.rs
index 49685ee4592..c91580ae0c4 100644
--- a/tests/ui/panic-handler/panic-handler-wrong-location.rs
+++ b/tests/ui/panic-handler/panic-handler-wrong-location.rs
@@ -6,3 +6,5 @@
 #[panic_handler] //~ ERROR `panic_impl` lang item must be applied to a function
 #[no_mangle]
 static X: u32 = 42;
+
+//~? ERROR `#[panic_handler]` function required, but not found