From da42d7c78332b5c239616760ad954c8a14895c3d Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Wed, 11 Dec 2024 18:51:55 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Travis Cross --- src/expressions.md | 2 +- src/expressions/grouped-expr.md | 2 +- src/expressions/method-call-expr.md | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/expressions.md b/src/expressions.md index a275cd80a..d4948274c 100644 --- a/src/expressions.md +++ b/src/expressions.md @@ -197,7 +197,7 @@ Explicitly, the assignee expressions are: fields). - [Unit structs][_StructExpression_]. -r[expr.place-value.parentehesis] +r[expr.place-value.parenthesis] Arbitrary parenthesisation is permitted inside assignee expressions. ### Moved and copied types diff --git a/src/expressions/grouped-expr.md b/src/expressions/grouped-expr.md index 77d499657..1738864d6 100644 --- a/src/expressions/grouped-expr.md +++ b/src/expressions/grouped-expr.md @@ -18,7 +18,7 @@ r[expr.paren.place-or-value] 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] +r[expr.paren.override-precedence] Parentheses can be used to explicitly modify the precedence order of subexpressions within an expression. An example of a parenthesized expression: diff --git a/src/expressions/method-call-expr.md b/src/expressions/method-call-expr.md index 341b9c9d2..18bb218ca 100644 --- a/src/expressions/method-call-expr.md +++ b/src/expressions/method-call-expr.md @@ -24,11 +24,11 @@ When looking up a method call, the receiver may be automatically dereferenced or 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] +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] +r[expr.method.candidate-receivers-refs] Then, for each candidate `T`, add `&T` and `&mut T` to the list immediately after `T`. For instance, if the receiver has type `Box<[i32;2]>`, then the candidate types will be `Box<[i32;2]>`, `&Box<[i32;2]>`, `&mut Box<[i32;2]>`, `[i32; 2]` (by dereferencing), `&[i32; 2]`, `&mut [i32; 2]`, `[i32]` (by unsized coercion), `&[i32]`, and finally `&mut [i32]`. @@ -69,14 +69,14 @@ Then, for each candidate type `T`, search for a [visible] method with a receiver > } > ``` -r[expr.method.ambiguious-target] +r[expr.method.ambiguous-target] If this results in multiple possible candidates, then it is an error, and the receiver must be [converted][disambiguate call] to an appropriate receiver type to make the method call. r[expr.method.constraint] 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] +r[expr.method.ambiguous-search] If a step is reached where there is more than one possible method, such as where generic methods or traits are considered the same, then it is a compiler error. These cases require a [disambiguating function call syntax] for method and function invocation.