Skip to content

Commit 7ac731a

Browse files
committed
Minor update of must_use
More closely align with the template, and some minor word tweaks.
1 parent 89a82f7 commit 7ac731a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/attributes/diagnostics.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ The [RFC][1270-deprecation.md] contains motivations and more details.
345345

346346
[1270-deprecation.md]: https://github.com/rust-lang/rfcs/blob/master/text/1270-deprecation.md
347347

348+
<!-- template:attributes -->
348349
r[attributes.diagnostics.must_use]
349350
## The `must_use` attribute
350351

@@ -373,13 +374,13 @@ The `must_use` attribute may be applied to a:
373374
- [Trait]
374375
375376
> [!NOTE]
376-
> `rustc` currently warns in other positions, but this may be rejected in the future.
377+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
377378
378379
r[attributes.diagnostics.must_use.duplicates]
379-
The `must_use` attribute may only be specified once on an item.
380+
The `must_use` attribute may be used only once on an item.
380381
381382
> [!NOTE]
382-
> `rustc` currently warns on subsequent duplicate `must_use` attributes. This may become an error in the future.
383+
> `rustc` lints against any use following the first. This may become an error in the future.
383384
384385
r[attributes.diagnostics.must_use.message]
385386
The `must_use` attribute may include a message by using the [MetaNameValueStr] syntax such as `#[must_use = "example message"]`. The message will be given alongside the warning.

0 commit comments

Comments
 (0)