Skip to content

Commit fd0e5b6

Browse files
committed
Updated the RFC to include lessons learned from rust-lang#1812
1 parent f31e5e5 commit fd0e5b6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

text/0000-must-use-functions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ explicitly opt-in to also having important results, e.g. `#[must_use]
7878
fn ok(self) -> Option<T>`. This is a natural generalisation of
7979
`#[must_use]` to allow fine-grained control of context sensitive info.
8080

81+
One of the most important use-cases for this would be annotating `PartialEq::{eq, ne}` with `#[must_use]`.
82+
83+
There's a bug in Android where instead of `modem_reset_flag = 0;` the file affected has `modem_reset_flag == 0;`.
84+
Rust does not do better in this case. If you wrote `modem_reset_flag == false;` the compiler would be perfectly happy and wouldn't warn you.
85+
86+
See further discussion in [#1812.](https://github.com/rust-lang/rfcs/pull/1812)
87+
8188
# Detailed design
8289

8390
If a semicolon discards the result of a function or method tagged with

0 commit comments

Comments
 (0)