paritytech / paritytech/subxt

Unclear path substition rules

Open
#1,464 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
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:

  1. what is the relative base module needed to get a substitution match?
  2. does it have to be absolute paths?
  3. 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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.