rust-lang / rust-lang/libs-team

Could not find module `Ident(mask_impl)`

Open
#98 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-unstable-api
Dominant language
Rust
Stars
178
Forks
28
Avg merge
15m
Merged PRs (30d)
1

Description

This relatively recent code in the standard library is problematic for the cargo-unstable-api tool:

https://github.com/rust-lang/rust/blob/1.63.0/library/portable-simd/crates/core_simd/src/masks.rs#L5-L13

It fails with:

Error: could not find module `Ident(mask_impl)` in any of [
"library/core/src/../../portable-simd/crates/core_simd/src/masks/mask_impl.rs",
"library/core/src/../../portable-simd/crates/core_simd/src/masks/mask_impl/mod.rs",
] (this is a bug)

One of the cfg_attrs is a not of the other one, so at least one should definitely apply — that is, the tool should be loading either core_simd/src/masks/full_masks.rs or core_simd/src/masks/bitmask.rs (if the intention is to display the API for a single configuration only) or both (if the intention is to display the API of all configurations), but never core_simd/src/masks/mask_impl.rs or core_simd/src/masks/mask_impl/mod.rs.

The syn-inline-mod crate already implements loading of modules behind cfg attributes, so it shouldn't be necessary to reimplement all this logic in cargo-unstable-api.

Contributor guide

No contributing guide indexed for this repository

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 in the cargo-unstable-api module-loading path and reproduce the failure using library/portable-simd/crates/core_simd/src/masks.rs. Compare the existing cfg-attribute handling with syn-inline-mod, then verify that loading selects full_masks.rs or bitmask.rs rather than mask_impl.rs; done means the reported module error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.