Skip to content

Commit

Permalink
Auto merge of #12462 - CBSpeir:clippy-book-typo, r=flip1995
Browse files Browse the repository at this point in the history
Fix typo in section '6.10. Macro Expansions' of the Clippy Book

Under the "Span.ctxt method" heading in *Section 6.10. Macro Expansions* of the *Clippy Book*, the type returned by the
`Span::ctxt` method is listed as `SpanContext`.  The correct type name should be `SyntaxContext`.

---

changelog: Fixed typo in "Section 6.10. Macro Expansions" of the Clippy Book. `SpanContext` changed to `SyntaxContext`.
  • Loading branch information
bors committed Mar 12, 2024
2 parents e22ca03 + d66a0ec commit 60f7f06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/src/development/macro_expansions.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if expr.span.from_expansion() {

### `Span.ctxt` method

The `span`'s context, given by the method [`ctxt`] and returning [SpanContext],
The `span`'s context, given by the method [`ctxt`] and returning [SyntaxContext],
represents if the span is from a macro expansion and, if it is, which
macro call expanded this span.

Expand Down Expand Up @@ -155,4 +155,4 @@ if in_external_macro(cx.sess(), foo_span) {
[`from_expansion`]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_span/struct.Span.html#method.from_expansion
[`in_external_macro`]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_middle/lint/fn.in_external_macro.html
[Span]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_span/struct.Span.html
[SpanContext]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_span/hygiene/struct.SyntaxContext.html
[SyntaxContext]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_span/hygiene/struct.SyntaxContext.html

0 comments on commit 60f7f06

Please sign in to comment.