rust-lang / rust-lang/rust-bindgen
Include template arguments in instantiations' names (support marking "nested" instantiations as opaque)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Follow up to #773
To fully support template instantiations, and particularly template instantiations where a template argument is another template instantiation, with our various flags that depend on names (eg marking things opaque) we need to stop making template instantiations just use their template definition's name and start appending their template arguments.
The catch is that there are a bunch of places that assume that the names we return are valid rust identifiers and don't have characters like < in them. I kind of feel like we want multiple name-getting traits and/or multiple different name-getting methods on the ItemCanonicalName trait. Or maybe even extending the ItemCanonicalPath to return a tree rather than a vec so we can properly represent paths with instantiations and have each instantiation argument also be a path...
Anyways, after #773, we can make certain instantiations opaque, like Rooted<SavedFrameCache>, but not any "nested" instantiations, like Rooted<Cache<SavedFrame>>. Supporting the latter requires figuring out this naming mess.
Contributor guide
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 with issue #773, then inspect the ItemCanonicalName trait and ItemCanonicalPath references mentioned here. Determine how nested template instantiations should represent their arguments without breaking callers that require Rust identifiers. Done means nested names such as Rooted<Cache> are represented and can be marked opaque.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100