Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Spec Identifier Syntax to expressions.md and subchapters #1591

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

chorman0773
Copy link
Contributor

This adds identifier syntax to expressions.md and all subchapters.

@chorman0773 chorman0773 added S-waiting-on-review Status: The marked PR is awaiting review from a maintainer T-spec Team: spec labels Aug 27, 2024
@chorman0773 chorman0773 self-assigned this Aug 27, 2024
src/expressions.md Outdated Show resolved Hide resolved
@@ -169,29 +197,46 @@ Explicitly, the assignee expressions are:
fields).
- [Unit structs][_StructExpression_].

r[expr.place-value.parentehesis]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r[expr.place-value.parentehesis]
r[expr.place-value.parenthesis]

Unlike other expressions, parenthesized expressions are both [place expressions and value expressions][place].
When the enclosed operand is a place expression, it is a place expression and when the enclosed operand is a value expression, it is a value expression.

r[expr.paren.overridew-precedence]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r[expr.paren.overridew-precedence]
r[expr.paren.override-precedence]

When looking up a method call, the receiver may be automatically dereferenced or borrowed in order to call a method.
This requires a more complex lookup process than for other functions, since there may be a number of possible methods to call.
The following procedure is used:

r[expr.method.candidate-recievers]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r[expr.method.candidate-recievers]
r[expr.method.candidate-receivers]

The first step is to build a list of candidate receiver types.
Obtain these by repeatedly [dereferencing][dereference] the receiver expression's type, adding each type encountered to the list, then finally attempting an [unsized coercion] at the end, and adding the result type if that is successful.

r[expr.method.candidate-recievers-refs]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r[expr.method.candidate-recievers-refs]
r[expr.method.candidate-receivers-refs]

@@ -58,11 +69,14 @@ Then, for each candidate type `T`, search for a [visible] method with a receiver
> }
> ```

r[expr.method.ambiguious-target]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r[expr.method.ambiguious-target]
r[expr.method.ambiguous-target]

This process does not take into account the mutability or lifetime of the receiver, or whether a method is `unsafe`.
Once a method is looked up, if it can't be called for one (or more) of those reasons, the result is a compiler error.

r[expr.method.ambiguious-search]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r[expr.method.ambiguious-search]
r[expr.method.ambiguous-search]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer T-spec Team: spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants