Skip to content

Commit

Permalink
Rollup merge of rust-lang#105522 - est31:remove_or_and_note, r=scottmcm
Browse files Browse the repository at this point in the history
Remove wrong note for short circuiting operators

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](rust-lang/rfcs#2722). As it is not accurate, remove most of the note.
  • Loading branch information
matthiaskrgr committed Dec 10, 2022
2 parents 6d7e3df + f069e71 commit f6c2add
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 f6c2add

Please sign in to comment.