rust-lang / rust-lang/libc

ctest: Check public API in modules

Open
#5,365 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

Currently ctest requires everything on the Rust side to be available at the crate root. We should check nested modules too, though, since we may have more in the future when things conflict.

I think this could be implemented by adding API to ctest like the following:

// Same for `Struct`, `Const`, etc
impl Struct {
    pub fn path() -> ItemPath;
}

pub struct ItemPath(BoxStr);

impl ItemPath {
    pub fn as_str(&self) -> &str {
        &self.0
    }

    pub fn components(&self) -> impl DoubleEndedIterator<Item = &str> {
        self.0.split("::")
    }
}

Cc @mbyx

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 by reading ctest's existing crate-root API checking and inspect how items such as Struct and Const are represented. Trace how paths are currently handled, then verify that nested module paths can be checked and that the proposed ItemPath behavior is covered by tests or equivalent validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.