You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/items/associated-items.md
+1-3
Original file line number
Diff line number
Diff line change
@@ -213,9 +213,7 @@ let bounding_box = circle_shape.bounding_box();
213
213
214
214
r[items.associated.fn.params.edition2018]
215
215
> [!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.
Copy file name to clipboardexpand all lines: src/items/use-declarations.md
+2-4
Original file line number
Diff line number
Diff line change
@@ -140,8 +140,7 @@ fn example() {
140
140
141
141
r[items.use.path.edition2018]
142
142
> [!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:
145
144
>
146
145
> ```rust,edition2015
147
146
> mod foo {
@@ -311,8 +310,7 @@ r[items.use.glob.self-import]
311
310
312
311
r[items.use.glob.edition2018]
313
312
> [!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.
Copy file name to clipboardexpand all lines: src/names/preludes.md
+3-9
Original file line number
Diff line number
Diff line change
@@ -58,12 +58,9 @@ The [`std`] crate is added as long as the [`no_std` attribute] is not specified
58
58
59
59
r[names.preludes.extern.edition2018]
60
60
> [!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.
64
62
>
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`.
67
64
68
65
> [!NOTE]
69
66
> 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].
157
154
158
155
r[names.preludes.no_implicit_prelude.edition2018]
159
156
> [!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.
Copy file name to clipboardexpand all lines: src/paths.md
+2-6
Original file line number
Diff line number
Diff line change
@@ -190,13 +190,9 @@ the path must resolve to an item.
190
190
191
191
r[paths.qualifiers.global-root.edition2018]
192
192
> [!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).
197
194
>
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.
Copy file name to clipboardexpand all lines: src/tokens.md
+3-7
Original file line number
Diff line number
Diff line change
@@ -442,8 +442,7 @@ c"\xC3\xA6";
442
442
443
443
r[lex.token.str-c.edition2021]
444
444
> [!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 ""`.
447
446
448
447
r[lex.token.str-c-raw]
449
448
#### Raw C string literals
@@ -474,9 +473,7 @@ literal) or `U+005C` (`\`) do not have any special meaning.
474
473
475
474
r[lex.token.str-c-raw.edition2021]
476
475
> [!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).
480
477
481
478
#### Examples for C string and raw C string literals
482
479
@@ -777,8 +774,7 @@ It is an error to use the RESERVED_RAW_LIFETIME token `'r#_` in order to avoid c
777
774
778
775
r[lex.token.life.raw.edition2021]
779
776
> [!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`.
Copy file name to clipboardexpand all lines: src/types/trait-object.md
+3-9
Original file line number
Diff line number
Diff line change
@@ -40,19 +40,13 @@ For example, given a trait `Trait`, the following are all trait objects:
40
40
41
41
r[type.trait-object.syntax-edition2021]
42
42
> [!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.
45
44
46
45
r[type.trait-object.syntax-edition2018]
47
46
> [!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)`.
53
48
>
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.
56
50
57
51
r[type.trait-object.alias]
58
52
Two trait object types alias each other if the base traits alias each other and
Copy file name to clipboardexpand all lines: src/visibility-and-privacy.md
+1-3
Original file line number
Diff line number
Diff line change
@@ -177,9 +177,7 @@ to `pub(in self)` or not using `pub` at all.
177
177
178
178
r[vis.scoped.edition2018]
179
179
> [!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.
0 commit comments