Skip to content

Commit

Permalink
Correct wrong note for short circuiting operators
Browse files Browse the repository at this point in the history
They *are* representable by traits, even if the short-circuiting
behaviour requires a different approach than the non-short-circuiting
operators. For an example proposal, see the postponed RFC 2722.
As it is not accurate, reword the note.
  • Loading branch information
est31 committed Dec 10, 2022
1 parent 0d5573e commit f069e71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
//! should have some resemblance to multiplication (and share expected
//! properties like associativity).
//!
//! Note that the `&&` and `||` operators short-circuit, i.e., they only
//! evaluate their second operand if it contributes to the result. Since this
//! behavior is not enforceable by traits, `&&` and `||` are not supported as
//! overloadable operators.
//! Note that the `&&` and `||` operators are currently not supported for
//! overloading. Due to their short circuiting nature, they require a different
//! design from traits for other operators like [`BitAnd`]. Designs for them are
//! under discussion.
//!
//! Many of the operators take their operands by value. In non-generic
//! contexts involving built-in types, this is usually not a problem.
Expand Down

0 comments on commit f069e71

Please sign in to comment.