Skip to content

Commit 621ccf5

Browse files
committed
Auto merge of #23186 - steveklabnik:gh14686, r=alexcrichton
Fixes #14686
2 parents 12b846a + a600899 commit 621ccf5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/doc/complement-design-faq.md

+7
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,10 @@ bindings.
174174
See also [a long thread][alt] on renaming `let mut` to `var`.
175175

176176
[alt]: https://mail.mozilla.org/pipermail/rust-dev/2014-January/008319.html
177+
178+
## Why no `--x` or `x++`?
179+
180+
Preincrement and postincrement, while convenient, are also fairly complex. They
181+
require knowledge of evaluation order, and often lead to subtle bugs and
182+
undefined behavior in C and C++. `x = x + 1` or `x += 1` is only slightly
183+
longer, but unambiguous.

0 commit comments

Comments
 (0)