rust-lang / rust-lang/libc

ctest: Figure out a way to test anonymous structs/unions

Open
#4,650 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ctest
Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

We should provide a cfg way to identify a union or struct field as anonymous. This can probably be a is_field_anonymous function that would make ctest "inline" the relevant tests.

This discussion was started at https://github.com/rust-lang/libc/pull/4610#discussion_r2272226633 but I don't think we actually need that tricky regex pattern.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ctest-related discussion in issue #4650 and the linked pull request discussion. Determine how anonymous struct and union fields should be identified through cfg, and define how ctest should inline the relevant tests. Done means the approach is implemented and anonymous-field tests are exercised without relying on the rejected tricky regex pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.