Skip to content

Commit 05e9434

Browse files
committedMar 20, 2025
Unwrap edition blocks
To follow the style guide.
1 parent 059b467 commit 05e9434

8 files changed

+16
-43
lines changed
 

‎src/items/associated-items.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ let bounding_box = circle_shape.bounding_box();
213213

214214
r[items.associated.fn.params.edition2018]
215215
> [!EDITION-2018]
216-
> In the 2015 edition, it is possible to declare trait
217-
> methods with anonymous parameters (e.g. `fn foo(u8)`). This is deprecated and
218-
> an error as of the 2018 edition. All parameters must have an argument name.
216+
> 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.
219217
220218
r[items.associated.fn.param-attributes]
221219
#### Attributes on method parameters

‎src/items/functions.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ For more information on the effect of async, see [`async` blocks][async-blocks].
361361

362362
r[items.fn.async.edition2018]
363363
> [!EDITION-2018]
364-
> Async functions are only available beginning with
365-
> Rust 2018.
364+
> Async functions are only available beginning with Rust 2018.
366365
367366
r[items.fn.async.safety]
368367
### Combining `async` and `unsafe`

‎src/items/use-declarations.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ fn example() {
140140

141141
r[items.use.path.edition2018]
142142
> [!EDITION-2018]
143-
> In the 2015 edition, `use` paths are relative to the crate root.
144-
> For example:
143+
> In the 2015 edition, `use` paths are relative to the crate root. For example:
145144
>
146145
> ```rust,edition2015
147146
> mod foo {
@@ -311,8 +310,7 @@ r[items.use.glob.self-import]
311310

312311
r[items.use.glob.edition2018]
313312
> [!EDITION-2018]
314-
> In the 2015 edition, paths are relative to the crate root, so an import such as `use *;` is valid, and it means to import everything from the crate root.
315-
> This cannot be used in the crate root itself.
313+
> In the 2015 edition, paths are relative to the crate root, so an import such as `use *;` is valid, and it means to import everything from the crate root. This cannot be used in the crate root itself.
316314
317315
r[items.use.as-underscore]
318316
## Underscore Imports

‎src/names/preludes.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ The [`std`] crate is added as long as the [`no_std` attribute] is not specified
5858

5959
r[names.preludes.extern.edition2018]
6060
> [!EDITION-2018]
61-
> In the 2015 edition, crates in the extern prelude
62-
> cannot be referenced via [use declarations], so it is generally standard
63-
> practice to include `extern crate` declarations to bring them into scope.
61+
> 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.
6462
>
65-
> Beginning in the 2018 edition, [use declarations] can reference crates in
66-
> the extern prelude, so it is considered unidiomatic to use `extern crate`.
63+
> Beginning in the 2018 edition, [use declarations] can reference crates in the extern prelude, so it is considered unidiomatic to use `extern crate`.
6764
6865
> [!NOTE]
6966
> Additional crates that ship with `rustc`, such as [`alloc`], and [`test`](mod@test), are not automatically included with the `--extern` flag when using Cargo. They must be brought into scope with an `extern crate` declaration, even in the 2018 edition.
@@ -157,10 +154,7 @@ This attribute does not affect the [language prelude].
157154
158155
r[names.preludes.no_implicit_prelude.edition2018]
159156
> [!EDITION-2018]
160-
> In the 2015 edition, the `no_implicit_prelude`
161-
> attribute does not affect the [`macro_use` prelude], and all macros exported
162-
> from the standard library are still included in the `macro_use` prelude.
163-
> Starting in the 2018 edition, it will remove the `macro_use` prelude.
157+
> 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.
164158
165159
[`extern crate`]: ../items/extern-crates.md
166160
[`macro_use` attribute]: ../macros-by-example.md#the-macro_use-attribute

‎src/paths.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,9 @@ the path must resolve to an item.
190190

191191
r[paths.qualifiers.global-root.edition2018]
192192
> [!EDITION-2018]
193-
> In the 2015 Edition, identifiers resolve from the "crate root"
194-
> (`crate::` in the 2018 edition), which contains a variety of different items, including
195-
> external crates, default crates such as `std` or `core`, and items in the top level of
196-
> the crate (including `use` imports).
193+
> 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).
197194
>
198-
> Beginning with the 2018 Edition, paths starting with `::` resolve from
199-
> crates in the [extern prelude]. That is, they must be followed by the name of a crate.
195+
> Beginning with the 2018 Edition, paths starting with `::` resolve from crates in the [extern prelude]. That is, they must be followed by the name of a crate.
200196
201197
```rust
202198
pub fn foo() {

‎src/tokens.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ c"\xC3\xA6";
442442

443443
r[lex.token.str-c.edition2021]
444444
> [!EDITION-2021]
445-
> C string literals are accepted in the 2021 edition or
446-
> later. In earlier additions the token `c""` is lexed as `c ""`.
445+
> C string literals are accepted in the 2021 edition or later. In earlier additions the token `c""` is lexed as `c ""`.
447446
448447
r[lex.token.str-c-raw]
449448
#### Raw C string literals
@@ -474,9 +473,7 @@ literal) or `U+005C` (`\`) do not have any special meaning.
474473

475474
r[lex.token.str-c-raw.edition2021]
476475
> [!EDITION-2021]
477-
> Raw C string literals are accepted in the 2021
478-
> edition or later. In earlier additions the token `cr""` is lexed as `cr ""`,
479-
> and `cr#""#` is lexed as `cr #""#` (which is non-grammatical).
476+
> 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).
480477
481478
#### Examples for C string and raw C string literals
482479

@@ -777,8 +774,7 @@ It is an error to use the RESERVED_RAW_LIFETIME token `'r#_` in order to avoid c
777774

778775
r[lex.token.life.raw.edition2021]
779776
> [!EDITION-2021]
780-
> Raw lifetimes are accepted in the 2021
781-
> edition or later. In earlier additions the token `'r#lt` is lexed as `'r # lt`.
777+
> Raw lifetimes are accepted in the 2021 edition or later. In earlier additions the token `'r#lt` is lexed as `'r # lt`.
782778
783779
r[lex.token.punct]
784780
## Punctuation

‎src/types/trait-object.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,13 @@ For example, given a trait `Trait`, the following are all trait objects:
4040

4141
r[type.trait-object.syntax-edition2021]
4242
> [!EDITION-2021]
43-
> Before the 2021 edition, the `dyn` keyword may be
44-
> omitted.
43+
> Before the 2021 edition, the `dyn` keyword may be omitted.
4544
4645
r[type.trait-object.syntax-edition2018]
4746
> [!EDITION-2018]
48-
> In the 2015 edition, if the first bound of the
49-
> trait object is a path that starts with `::`, then the `dyn` will be treated
50-
> as a part of the path. The first path can be put in parenthesis to get
51-
> around this. As such, if you want a trait object with the trait
52-
> `::your_module::Trait`, you should write it as `dyn (::your_module::Trait)`.
47+
> 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 `::your_module::Trait`, you should write it as `dyn (::your_module::Trait)`.
5348
>
54-
> Beginning in the 2018 edition, `dyn` is a true keyword and is not allowed in
55-
> paths, so the parentheses are not necessary.
49+
> Beginning in the 2018 edition, `dyn` is a true keyword and is not allowed in paths, so the parentheses are not necessary.
5650
5751
r[type.trait-object.alias]
5852
Two trait object types alias each other if the base traits alias each other and

‎src/visibility-and-privacy.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ to `pub(in self)` or not using `pub` at all.
177177

178178
r[vis.scoped.edition2018]
179179
> [!EDITION-2018]
180-
> Starting with the 2018 edition, paths for
181-
> `pub(in path)` must start with `crate`, `self`, or `super`. The 2015 edition
182-
> may also use paths starting with `::` or modules from the crate root.
180+
> 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.
183181
184182
Here's an example:
185183

0 commit comments

Comments
 (0)