UFCS RFC needs to be clearer about method call syntax
@pnkfelix is already working on this.
Since Oct 17, 2018.
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
Description
RFC PR #132 (UFCS) had many descriptions of various paths, but completely omitted concrete examples of an actual method call (with the receiver expression and the arguments) written via the proposed notation.
In particular, assuming a trait ToStr { fn to_str(&self) -> String } and type S that implements ToStr and also has its own impl S { fn to_str(&self, max: uint) -> String } are we expecting to be able to write:
fn f(s: &S) -> String { s.ToStr::to_str() }, orfn f(s: &S) -> String { ToStr::to_str(s) }, or- both?
and likewise:
fn g(s: &S) -> String { s.<S>::to_str(10) }, orfn g(s: &S) -> String { <S>::to_str(s, 10) }, or- both?
(Perhaps the answer is implied by some other document that specifies whether method call expressions use a full path for the method name, or just an identifier and optional generics args list ::<T, U, ...>. Nonetheless this detail is important enough to go into the document itself.)
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.
Assessment
This issue has not been assessed yet.