Skip to content

Commit ff65b3d

Browse files
committed
Update templatized attributes text
There's been some editorial drift as we've revised the text for these attributes. Let's align the ones that have been templatized with the revised template.
1 parent 4805ac9 commit ff65b3d

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

src/attributes/codegen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ r[attributes.codegen.no_builtins.duplicates]
106106
Only the first use of the `no_builtins` attribute has effect.
107107
108108
> [!NOTE]
109-
> `rustc` currently lints against uses following the first.
109+
> `rustc` lints against any use following the first.
110110
111111
r[attributes.codegen.target_feature]
112112
## The `target_feature` attribute

src/attributes/derive.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ r[attributes.derive.syntax]
3737
The `derive` attribute uses the [MetaListPaths] syntax to specify a list of paths to [derive macros] to invoke.
3838
3939
r[attributes.derive.allowed-positions]
40-
The `derive` attribute may be applied to [structs][items.struct], [enums][items.enum], and [unions][items.union].
40+
The `derive` attribute may only be applied to [structs][items.struct], [enums][items.enum], and [unions][items.union].
4141
4242
r[attributes.derive.duplicates]
43-
The `derive` attribute may be specified multiple times on an item, with all derive macros listed in all attributes being invoked.
43+
The `derive` attribute may be used any number of times on an item. All derive macros listed in all attributes are invoked.
4444
4545
r[attributes.derive.stdlib]
4646
The `derive` attribute is exported in the standard library prelude as [`core::prelude::v1::derive`].
@@ -86,19 +86,19 @@ The *`automatically_derived` [attribute][attributes]* is used to annotate an [im
8686
> ```
8787
8888
r[attributes.derive.automatically_derived.syntax]
89-
The `automatically_derived` attribute uses the [MetaWord] syntax and so does not accept any arguments.
89+
The `automatically_derived` attribute uses the [MetaWord] syntax.
9090
9191
r[attributes.derive.automatically_derived.allowed-positions]
92-
The `automatically_derived` attribute may be placed on an [implementation].
92+
The `automatically_derived` attribute may only be applied to an [implementation].
9393
9494
> [!NOTE]
95-
> `rustc` currently accepts the attribute in other positions but lints against it.
95+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
9696
9797
r[attributes.derive.automatically_derived.duplicates]
98-
Duplicate instances of the `automatically_derived` attribute on the same implementation have no effect.
98+
Using `automatically_derived` more than once on an implementation has the same effect as using it once.
9999
100100
> [!NOTE]
101-
> `rustc` lints against duplicate use of this attribute on uses following the first.
101+
> `rustc` lints against any use following the first.
102102
103103
r[attributes.derive.automatically_derived.behavior]
104104
The `automatically_derived` attribute has no behavior.

src/attributes/limits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ r[attributes.limits.type_length_limit.duplicates]
8181
Only the first use of `type_length_limit` on an item has effect.
8282
8383
> [!NOTE]
84-
> `rustc` lints against use following the first. This may become an error in the future.
84+
> `rustc` lints against any use following the first. This may become an error in the future.
8585
8686
[attributes]: ../attributes.md
8787
[crate]: ../crates-and-source-files.md

src/attributes/testing.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The *`test` [attribute][attributes]* marks a function to be executed as a test.
2424
> ```
2525
2626
r[attributes.testing.test.syntax]
27-
The `test` attribute uses the [MetaWord] syntax and thus does not take any inputs.
27+
The `test` attribute uses the [MetaWord] syntax.
2828
2929
r[attributes.testing.test.allowed-positions]
3030
The `test` attribute may only be applied to [free functions] that are monomorphic, that take no arguments, and where the return type implements the [`Termination`] trait.
@@ -35,10 +35,10 @@ The `test` attribute may only be applied to [free functions] that are monomorphi
3535
> * `Result<T, E> where T: Termination, E: Debug`
3636
3737
r[attributes.testing.test.duplicates]
38-
Only the first instance of `test` on a function is honored.
38+
Only the first use of `test` on a function has effect.
3939
4040
> [!NOTE]
41-
> Subsequent `test` attributes are currently ignored and `rustc` warns about these.
41+
> `rustc` lints against any use following the first. This may become an error in the future.
4242
4343
<!-- TODO: This is a minor lie. Currently rustc warns that duplicates are ignored, but it then generates multiple test entries with the same name. I would vote for rejecting this in the future. -->
4444
@@ -92,7 +92,7 @@ The *`ignore` [attribute][attributes]* can be used with the [`test` attribute][a
9292
> The `rustc` test harness supports the `--include-ignored` flag to force ignored tests to be run.
9393
9494
r[attributes.testing.ignore.syntax]
95-
The `ignore` attribute uses either the [MetaWord] or [MetaNameValueStr] syntax.
95+
The `ignore` attribute uses the [MetaWord] and [MetaNameValueStr] syntaxes.
9696
9797
r[attributes.testing.ignore.reason]
9898
The [MetaNameValueStr] form of the `ignore` attribute provides a way to specify a reason why the test is ignored.
@@ -107,16 +107,16 @@ The [MetaNameValueStr] form of the `ignore` attribute provides a way to specify
107107
> ```
108108
109109
r[attributes.testing.ignore.allowed-positions]
110-
The `ignore` attribute may be applied to functions annotated with the `test` attribute.
110+
The `ignore` attribute may only be applied to functions annotated with the `test` attribute.
111111
112112
> [!NOTE]
113-
> `rustc` currently warns when `ignore` is used in some other situations. This may become an error in the future.
113+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
114114
115115
r[attributes.testing.ignore.duplicates]
116-
Only the first instance of `ignore` on a function is honored.
116+
Only the first use of `ignore` on a function has effect.
117117
118118
> [!NOTE]
119-
> `rustc` currently ignores duplicate `ignore` attributes. This may become an error in the future.
119+
> `rustc` lints against any use following the first. This may become an error in the future.
120120
121121
r[attributes.testing.ignore.behavior]
122122
Ignored tests are still compiled when in test mode, but they are not executed.
@@ -138,7 +138,7 @@ The *`should_panic` [attribute][attributes]* causes a test to pass only if the [
138138
> ```
139139
140140
r[attributes.testing.should_panic.syntax]
141-
The `should_panic` attribute has one of the following forms:
141+
The `should_panic` attribute has these forms:
142142
143143
- [MetaWord]
144144
> [!EXAMPLE]
@@ -168,13 +168,13 @@ r[attributes.testing.should_panic.allowed-positions]
168168
The `should_panic` attribute may only be applied to functions annotated with the `test` attribute.
169169
170170
> [!NOTE]
171-
> `rustc` currently accepts this attribute in other positions with a warning. This may become a hard error in the future.
171+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
172172
173173
r[attributes.testing.should_panic.duplicates]
174-
Only the first instance of `should_panic` on a function is honored.
174+
Only the first use of `should_panic` on a function has effect.
175175
176176
> [!NOTE]
177-
> `rustc` currently ignores subsequent `should_panic` attributes and emits a future-compatibility warning. This may become a hard error in the future.
177+
> `rustc` lints against any use following the first with a future-compatibility warning. This may become an error in the future.
178178
179179
r[attributes.testing.should_panic.expected]
180180
When the [MetaNameValueStr] form or the [MetaListNameValueStr] form with the `expected` key is used, the given string must appear somewhere within the panic message for the test to pass.

src/conditional-compilation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,13 @@ The syntax for the `cfg` attribute is:
364364
```
365365
366366
r[cfg.attr.allowed-positions]
367-
The `cfg` attribute is allowed anywhere attributes are allowed.
367+
The `cfg` attribute may be used anywhere attributes are allowed.
368368

369369
r[cfg.attr.duplicates]
370-
Multiple `cfg` attributes may be specified. The form to which the attribute is attached will not be included if any of the `cfg` predicates are false except as described in [cfg.attr.crate-level-attrs].
370+
The `cfg` attribute may be used any number of times on a form. The form to which the attributes are attached will not be included if any of the `cfg` predicates are false except as described in [cfg.attr.crate-level-attrs].
371371

372372
r[cfg.attr.effect]
373-
If the predicate is true, the form is rewritten to not have the `cfg` attribute on it. If the predicate is false, the form is removed from the source code.
373+
If the predicates are true, the form is rewritten to not have the `cfg` attributes on it. If any predicate is false, the form is removed from the source code.
374374

375375
r[cfg.attr.crate-level-attrs]
376376
When a crate-level `cfg` has a false predicate, the crate itself still exists. Any crate attributes preceding the `cfg` are kept, and any crate attributes following the `cfg` are removed as well as removing all of the following crate contents.
@@ -416,10 +416,10 @@ CfgAttrs -> Attr (`,` Attr)* `,`?
416416
```
417417
418418
r[cfg.cfg_attr.allowed-positions]
419-
The `cfg_attr` attribute is allowed anywhere attributes are allowed.
419+
The `cfg_attr` attribute may be used anywhere attributes are allowed.
420420

421421
r[cfg.cfg_attr.duplicates]
422-
Multiple `cfg_attr` attributes may be specified.
422+
The `cfg_attr` attribute may be used any number of times on a form.
423423

424424
r[cfg.cfg_attr.attr-restriction]
425425
The [`crate_type`] and [`crate_name`] attributes cannot be used with `cfg_attr`.

src/items/extern-crates.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ The *`no_link` [attribute][attributes]* may be applied to an `extern crate` item
9393
> ```
9494
9595
r[items.extern-crate.no_link.syntax]
96-
The `no_link` attribute uses the [MetaWord] syntax and so does not accept any arguments.
96+
The `no_link` attribute uses the [MetaWord] syntax.
9797
9898
r[items.extern-crate.no_link.allowed-positions]
9999
The `no_link` attribute may only be applied to an `extern crate` declaration.
100100
101101
> [!NOTE]
102-
> `rustc` currently accepts and ignores the attribute in other positions but lints against it. This may become a hard error in the future.
102+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
103103
104104
r[items.extern-crate.no_link.duplicates]
105-
Duplicate instances of the `no_link` attribute are ignored.
105+
Only the first use of `no_link` on an `extern crate` declaration has effect.
106106
107107
> [!NOTE]
108-
> `rustc` lints against duplicate use of this attribute.
108+
> `rustc` lints against any use following the first. This may become an error in the future.
109109
110110
[identifier]: ../identifiers.md
111111
[RFC 940]: https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md

src/items/external-blocks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@ r[items.extern.attributes.link_name.allowed-positions]
413413
The `link_name` attribute may only be applied to a function or static item in an `extern` block.
414414
415415
> [!NOTE]
416-
> `rustc` currently accepts and ignores the attribute in other positions but lints against it. This may become a hard error in the future.
416+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
417417
418418
r[items.extern.attributes.link_name.duplicates]
419-
Only the last instance of `link_name` on an item is used to determine the symbol name.
419+
Only the last use of `link_name` on an item has effect.
420420
421421
> [!NOTE]
422-
> `rustc` lints against duplicate use of this attribute on uses preceding the last. This may become a hard error in the future.
422+
> `rustc` lints against any use preceding the last. This may become an error in the future.
423423
424424
r[items.extern.attributes.link_name.link_ordinal]
425425
The `link_name` attribute may not be used with the [`link_ordinal`] attribute.

src/procedural-macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ r[macro.proc.derive.allowed-positions]
186186
The `proc_macro_derive` attribute may only be applied to a `pub` function with the [Rust ABI][items.fn.extern] defined in the root of the crate with a type of `fn(TokenStream) -> TokenStream` where [`TokenStream`] comes from the [`proc_macro` crate]. The function may be `const` and may use `extern` to explicitly specify the Rust ABI, but it may not use any other [qualifiers][FunctionQualifiers] (e.g. it may not be `async` or `unsafe`).
187187

188188
r[macro.proc.derive.duplicates]
189-
The `proc_macro_derive` attribute may be specified only once on a function.
189+
The `proc_macro_derive` attribute may be used only once on a function.
190190

191191
r[macro.proc.derive.namespace]
192192
The `proc_macro_derive` attribute publicly defines the derive macro in the [macro namespace] in the root of the crate.

src/runtime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ r[runtime.windows_subsystem.allowed-positions]
6464
The `windows_subsystem` attribute may only be applied to the crate root.
6565
6666
r[runtime.windows_subsystem.duplicates]
67-
Only the first use of `windows_subsystem` is honored.
67+
Only the first use of `windows_subsystem` has effect.
6868
6969
> [!NOTE]
70-
> `rustc` currently lints against uses following the first. This may become a hard error in the future.
70+
> `rustc` lints against any use following the first. This may become an error in the future.
7171
7272
r[runtime.windows_subsystem.ignored]
7373
The `windows_subsystem` attribute is ignored on non-Windows targets and non-`bin` [crate types].

0 commit comments

Comments
 (0)