Skip to content

Commit 532d28b

Browse files
jumbatmcamelid
andcommitted
Apply suggestions from review.
Co-authored-by: Camelid <[email protected]>
1 parent 33cf2e5 commit 532d28b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diagnostics/sessiondiagnostic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ tcx.sess.emit_err(FieldAlreadyDeclared {
3030
```
3131

3232
We see that using `SessionDiagnostic` is relatively straight forward. The `#[error = "..."]`
33-
attribute is used to supply the error code for the diagnostic. We are then annotate fields in the
34-
struct with various information of how to convert an instance of the struct into a proper
33+
attribute is used to supply the error code for the diagnostic. We then annotate fields in the
34+
struct with various information on how to convert an instance of the struct into a rendered
3535
diagnostic. The attributes above produce code which is roughly equivalent to the following (in
3636
pseudo-Rust):
3737

@@ -49,7 +49,7 @@ impl SessionDiagnostic for FieldAlreadyDeclared {
4949
```
5050

5151
The generated code draws attention to a number of features. First, we see that within the strings
52-
passed to each attribute, we see that field names can be referenced without needing to be passed
52+
passed to each attribute, field names can be referenced without needing to be passed
5353
explicitly into the format string -- in this example here, `#[message = "field {field_name} is
5454
already declared"]` produces a call to `format!` with the appropriate arguments to format
5555
`self.field_name` into the string. This applies to strings passed to all attributes.

0 commit comments

Comments
 (0)