Skip to content

Commit 9b25a4a

Browse files
author
Bhargav Voleti
committed
Clean up reference section
1 parent 6b423e0 commit 9b25a4a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

rfc-drafts/must_not_await_lint.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Example use cases for this lint:
4747

4848
- Any RAII guard might possibly create unintended behavior if held across an await boundary.
4949

50-
This lint will enable the compiler to warn the user that the generated MIR could produce unforeseen side effects. Some examples of this are:
50+
This lint will enable the compiler to warn the user that the code could produce unforeseen side effects. Some examples of this are:
5151

5252
- [`std::sync::MutexGuard`](https://doc.rust-lang.org/std/sync/struct.MutexGuard.html)
5353
- [`tracing::span::Entered`](https://docs.rs/tracing/0.1.15/tracing/span/struct.Entered.html)
@@ -60,7 +60,7 @@ The `must_not_await` attribute is used to issue a diagnostic warning when a valu
6060

6161
The `must_not_await` attribute may include a message by using the [`MetaNameValueStr`] syntax such as `#[must_not_await = "example message"]`. The message will be given alongside the warning.
6262

63-
When used on a user-defined composite type, if the [expression] of an [expression statement] has this type and is used across an await point, then this lint is violated.
63+
When used on a user-defined composite type, if a value exists across an await point, then this lint is violated.
6464

6565

6666
```rust
@@ -74,7 +74,7 @@ async fn foo() {
7474
}
7575
```
7676

77-
When used on a function, if the [expression] of an [expression statement] is a [call expression] to that function, and the expression is held across an await point, this lint is violated.
77+
When used on a function, if the value returned by a function is held across an await point, this lint is violated.
7878

7979
```rust
8080
#[must_not_await]
@@ -87,7 +87,7 @@ async fn foo() {
8787
}
8888
```
8989

90-
When used on a [trait declaration], a [call expression] of an [expression statement] to a function that returns an [impl trait] of that trait and if the value is held across an await point, the lint is violated.
90+
When used on a [trait declaration], if the value implementing that trait is held across an await point, the lint is violated.
9191

9292
```rust
9393
trait Trait {
@@ -109,11 +109,7 @@ async fn foo() {
109109
When used on a function in a trait implementation, the attribute does nothing.
110110

111111
[`MetaNameValueStr`]: https://doc.rust-lang.org/reference/attributes.html#meta-item-attribute-syntax
112-
[expression]: https://doc.rust-lang.org/reference/expressions.html
113-
[expression statement]: https://doc.rust-lang.org/reference/statements.html#expression-statements
114-
[call expression]: https://doc.rust-lang.org/reference/expressions/call-expr.html
115112
[trait declaration]: https://doc.rust-lang.org/reference/items/traits.html
116-
[impl trait]: https://doc.rust-lang.org/reference/types/impl-trait.html
117113

118114

119115
# Drawbacks

0 commit comments

Comments
 (0)