Skip to content

Commit

Permalink
Merge pull request #1586 from ehuss/edition-differences-capitalization
Browse files Browse the repository at this point in the history
Be consistent about how "Edition differences" is capitalized
  • Loading branch information
traviscross authored Aug 27, 2024
2 parents a80c4a7 + 0c7f99a commit 0635f91
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ The reference does not document which targets exist, or the properties of specif

### Editions

The main text and flow should document only the current edition. Whenever there is a difference between editions, the differences should be called out with an "Edition Differences" block.
The main text and flow should document only the current edition. Whenever there is a difference between editions, the differences should be called out with an "Edition differences" block.
2 changes: 1 addition & 1 deletion src/expressions/method-call-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Once a method is looked up, if it can't be called for one (or more) of those rea
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.
> **Edition Differences**: Before the 2021 edition, during the search for visible methods, if the candidate receiver type is an [array type], methods provided by the standard library [`IntoIterator`] trait are ignored.
> **Edition differences**: Before the 2021 edition, during the search for visible methods, if the candidate receiver type is an [array type], methods provided by the standard library [`IntoIterator`] trait are ignored.
>
> The edition used for this purpose is determined by the token representing the method name.
>
Expand Down
4 changes: 2 additions & 2 deletions src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ These conventions are documented here.

An *example term* is an example of a term being defined.

* Differences in the language by which edition the crate is compiled under are in a blockquote that start with the words "Edition Differences:" in **bold**.
* Differences in the language by which edition the crate is compiled under are in a blockquote that start with the words "Edition differences:" in **bold**.

> **Edition Differences**: In the 2015 edition, this syntax is valid that is disallowed as of the 2018 edition.
> **Edition differences**: In the 2015 edition, this syntax is valid that is disallowed as of the 2018 edition.
* Notes that contain useful information about the state of the book or point out useful, but mostly out of scope, information are in blockquotes that start with the word "Note:" in **bold**.

Expand Down
2 changes: 1 addition & 1 deletion src/items/associated-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ let circle_shape = Circle::new();
let bounding_box = circle_shape.bounding_box();
```

> **Edition Differences**: In the 2015 edition, it is possible to declare trait
> **Edition differences**: In the 2015 edition, it is possible to declare trait
> methods with anonymous parameters (e.g. `fn foo(u8)`). This is deprecated and
> an error as of the 2018 edition. All parameters must have an argument name.
Expand Down
6 changes: 3 additions & 3 deletions src/macros-by-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ the `expr` fragment specifier. However, `_` is matched by the `expr` fragment
specifier when it appears as a subexpression.
For the same reason, a standalone [const block] is not matched but it is matched when appearing as a subexpression.

> **Edition Differences**: Starting with the 2021 edition, `pat` fragment-specifiers match top-level or-patterns (that is, they accept [_Pattern_]).
> **Edition differences**: Starting with the 2021 edition, `pat` fragment-specifiers match top-level or-patterns (that is, they accept [_Pattern_]).
>
> Before the 2021 edition, they match exactly the same fragments as `pat_param` (that is, they accept [_PatternNoTopAlt_]).
>
Expand Down Expand Up @@ -421,7 +421,7 @@ macro_rules! call_foo {
fn foo() {}
```

> **Version & Edition Differences**: Prior to Rust 1.30, `$crate` and
> **Version & Edition differences**: Prior to Rust 1.30, `$crate` and
> `local_inner_macros` (below) were unsupported. They were added alongside
> path-based imports of macros (described above), to ensure that helper macros
> did not need to be manually imported by users of a macro-exporting crate.
Expand Down Expand Up @@ -475,7 +475,7 @@ Matchers like `$i:expr,` or `$i:expr;` would be legal, however, because `,` and
`ident`, `ty`, or `path` fragment specifier.
* All other fragment specifiers have no restrictions.

> **Edition Differences**: Before the 2021 edition, `pat` may also be followed by `|`.
> **Edition differences**: Before the 2021 edition, `pat` may also be followed by `|`.
When repetitions are involved, then the rules apply to every possible number of
expansions, taking separators into account. This means:
Expand Down
4 changes: 2 additions & 2 deletions src/names/preludes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ new_name`, then the symbol `new_name` is instead added to the prelude.
The [`core`] crate is always added to the extern prelude. The [`std`] crate is
added as long as the [`no_std` attribute] is not specified in the crate root.

> **Edition Differences**: In the 2015 edition, crates in the extern prelude
> **Edition differences**: In the 2015 edition, crates in the extern prelude
> cannot be referenced via [use declarations], so it is generally standard
> practice to include `extern crate` declarations to bring them into scope.
>
Expand Down Expand Up @@ -132,7 +132,7 @@ module or any of its descendants.
This attribute does not affect the [language prelude].
> **Edition Differences**: In the 2015 edition, the `no_implicit_prelude`
> **Edition differences**: In the 2015 edition, the `no_implicit_prelude`
> attribute does not affect the [`macro_use` prelude], and all macros exported
> from the standard library are still included in the `macro_use` prelude.
> Starting in the 2018 edition, it will remove the `macro_use` prelude.
Expand Down
2 changes: 1 addition & 1 deletion src/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Paths starting with `::` are considered to be *global paths* where the segments
start being resolved from a place which differs based on edition. Each identifier in
the path must resolve to an item.

> **Edition Differences**: In the 2015 Edition, identifiers resolve from the "crate root"
> **Edition differences**: In the 2015 Edition, identifiers resolve from the "crate root"
> (`crate::` in the 2018 edition), which contains a variety of different items, including
> external crates, default crates such as `std` or `core`, and items in the top level of
> the crate (including `use` imports).
Expand Down
2 changes: 1 addition & 1 deletion src/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ For example, `0u8..=255u8` is irrefutable.
The range of values for an integer type is the closed range from its minimum to maximum value.
The range of values for a `char` type are precisely those ranges containing all Unicode Scalar Values: `'\u{0000}'..='\u{D7FF}'` and `'\u{E000}'..='\u{10FFFF}'`.

> **Edition Differences**: Before the 2021 edition, range patterns with both a lower and upper bound may also be written using `...` in place of `..=`, with the same meaning.
> **Edition differences**: Before the 2021 edition, range patterns with both a lower and upper bound may also be written using `...` in place of `..=`, with the same meaning.
## Reference patterns

Expand Down
6 changes: 3 additions & 3 deletions src/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ c"\u{00E6}";
c"\xC3\xA6";
```

> **Edition Differences**: C string literals are accepted in the 2021 edition or
> **Edition differences**: C string literals are accepted in the 2021 edition or
> later. In earlier additions the token `c""` is lexed as `c ""`.
#### Raw C string literals
Expand All @@ -400,7 +400,7 @@ encoding. The characters `U+0022` (double-quote) (except when followed by at
least as many `U+0023` (`#`) characters as were used to start the raw C string
literal) or `U+005C` (`\`) do not have any special meaning.

> **Edition Differences**: Raw C string literals are accepted in the 2021
> **Edition differences**: Raw C string literals are accepted in the 2021
> edition or later. In earlier additions the token `cr""` is lexed as `cr ""`,
> and `cr#""#` is lexed as `cr #""#` (which is non-grammatical).
Expand Down Expand Up @@ -735,7 +735,7 @@ Note that raw identifiers, raw string literals, and raw byte string literals may

Similarly the `r`, `b`, `br`, `c`, and `cr` prefixes used in raw string literals, byte literals, byte string literals, raw byte string literals, C string literals, and raw C string literals are not interpreted as reserved prefixes.

> **Edition Differences**: Starting with the 2021 edition, reserved prefixes are reported as an error by the lexer (in particular, they cannot be passed to macros).
> **Edition differences**: Starting with the 2021 edition, reserved prefixes are reported as an error by the lexer (in particular, they cannot be passed to macros).
>
> Before the 2021 edition, reserved prefixes are accepted by the lexer and interpreted as multiple tokens (for example, one token for the identifier or keyword, followed by a `#` token).
>
Expand Down
4 changes: 2 additions & 2 deletions src/types/trait-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ For example, given a trait `Trait`, the following are all trait objects:
* `dyn 'static + Trait`.
* `dyn (Trait)`

> **Edition Differences**: Before the 2021 edition, the `dyn` keyword may be
> **Edition differences**: Before the 2021 edition, the `dyn` keyword may be
> omitted.
>
> Note: For clarity, it is recommended to always use the `dyn` keyword on your
> trait objects unless your codebase supports compiling with Rust 1.26 or lower.
> **Edition Differences**: In the 2015 edition, if the first bound of the
> **Edition differences**: In the 2015 edition, if the first bound of the
> trait object is a path that starts with `::`, then the `dyn` will be treated
> as a part of the path. The first path can be put in parenthesis to get
> around this. As such, if you want a trait object with the trait
Expand Down
2 changes: 1 addition & 1 deletion src/visibility-and-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ follows:
- `pub(self)` makes an item visible to the current module. This is equivalent
to `pub(in self)` or not using `pub` at all.

> **Edition Differences**: Starting with the 2018 edition, paths for
> **Edition differences**: Starting with the 2018 edition, paths for
> `pub(in path)` must start with `crate`, `self`, or `super`. The 2015 edition
> may also use paths starting with `::` or modules from the crate root.
Expand Down

0 comments on commit 0635f91

Please sign in to comment.