rust/tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs
Jorge Aparicio ece8b0c94f make UI tests that use --test work on panic=abort targets
by adding `-Zpanic_abort_test`, which is a no-op on panic=unwind targets

fixes #135819
2025-01-21 17:39:15 +01:00

16 lines
346 B
Rust

// -Zpanic_abort_tests makes this test work on panic=abort targets and
// it's a no-op on panic=unwind targets
//@ compile-flags: --test -Zpanic_abort_tests
//@ run-pass
#![feature(core_intrinsics, generic_assert)]
#[should_panic(expected = "Custom user message")]
#[test]
fn test() {
assert!(1 == 3, "Custom user message");
}
fn main() {
}