Skip to content

Conversation

@tgross35
Copy link
Contributor

This allows us to print the entire slice on failure rather than only a
single mismatched byte.

A possible future improvement here would be to check if the type is an
integer in our template and call check_same instead if so, which would
let us print the decimal value as well.

@rustbot rustbot added ctest Issues relating to the ctest crate S-waiting-on-review labels Oct 28, 2025
@tgross35
Copy link
Contributor Author

Fyi @mbyx

@tgross35 tgross35 force-pushed the ctest-updates branch 3 times, most recently from 00c632e to dc482af Compare October 28, 2025 23:16
GCC flags function return values that include `volatile` even through
typedefs, such as with this example from NetBSD:

    typedef unsigned char __cpu_simple_lock_nv_t;
    typedef volatile __cpu_simple_lock_nv_t __cpu_simple_lock_t;
    typedef __cpu_simple_lock_t pthread_spin_t;
    pthread_spin_t foo() { return 0; }

Ignore the warning for the scope where we emit these tests.
@tgross35 tgross35 force-pushed the ctest-updates branch 2 times, most recently from f23557a to 2e7b7ca Compare October 28, 2025 23:31
@tgross35
Copy link
Contributor Author

For the first commit, verified that the volatile typedef does emit the warning in #4800

@tgross35 tgross35 enabled auto-merge October 28, 2025 23:38
This allows us to print the entire slice on failure rather than only a
single mismatched byte. Also use this as an opportunity to quote types
in failure messages.

A possible future improvement here would be to check if the type is an
integer in our template and call `check_same` instead if so, which would
let us print the decimal value as well.
@tgross35 tgross35 added this pull request to the merge queue Oct 29, 2025
Merged via the queue into rust-lang:main with commit 2c64edf Oct 29, 2025
90 of 145 checks passed
@tgross35 tgross35 deleted the ctest-updates branch October 29, 2025 02:44
@tgross35
Copy link
Contributor Author

tgross35 commented Nov 3, 2025

@rustbot label +stable-unneeded

@rustbot rustbot added the stable-unneeded This PR is applied to main but already exists on libc-0.2 label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ctest Issues relating to the ctest crate stable-unneeded This PR is applied to main but already exists on libc-0.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants