Unclear path substition rules
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 489
- Forks
- 293
- Avg merge
- 18h 35m
- Merged PRs (30d)
- 3
Description
It is not clear how to specify the substitute syn::Paths required as argument.
A few things remain puzzling:
- what is the relative base module needed to get a substitution match?
- does it have to be absolute paths?
- do bare types (so i.e. just an
Ident) themselves suffice for matching?
let path = &ty.ty.path;
// Don't generate a type if it was substituted - the target type might
// not be in the type registry + our resolution already performs the substitution.
if self.settings.substitutes.contains(dbg!(&path.segments)) {
continue;
}
is the relevant line, but it's not clear what path.segments contains and relative to what base.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the substitution check using self.settings.substitutes.contains(...) and inspect what path.segments contains during matching. Trace the substitution behavior to determine the relative-module, absolute-path, and bare-identifier rules, then document those answers clearly; the work is done when users can specify substitute syn::Paths without this ambiguity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100