From f6afb35c6170ad3cadc6e6d7d41dc4dc3bd46556 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sun, 6 Apr 2025 12:33:22 +1000 Subject: [PATCH] Prevent a test from seeing forbidden numbers in the rustc version The final CHECK-NOT directive in this test was able to see past the end of the enclosing function, and find the substring 753 or 754 in the git hash in the rustc version number, causing false failures in CI. Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing past the end of the function. --- tests/codegen/issues/issue-122600-ptr-discriminant-update.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs index fbea4ee8979fb..74bc824dbfefc 100644 --- a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs +++ b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs @@ -37,6 +37,8 @@ pub unsafe fn update(s: *mut State) { // CHECK-NOT: store // CHECK-NOT: memcpy // CHECK-NOT: 75{{3|4}} + + // CHECK: ret let State::A(v) = s.read() else { std::hint::unreachable_unchecked() }; s.write(State::B(v)); }