mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Document BinOp::is_checkable
This commit is contained in:
parent
938afba899
commit
b16d6ccdcd
@ -1999,6 +1999,9 @@ impl BorrowKind {
|
||||
}
|
||||
|
||||
impl BinOp {
|
||||
/// The checkable operators are those whose overflow checking behavior is controlled by
|
||||
/// -Coverflow-checks option. The remaining operators have either no overflow conditions (e.g.,
|
||||
/// BitAnd, BitOr, BitXor) or are always checked for overflow (e.g., Div, Rem).
|
||||
pub fn is_checkable(self) -> bool {
|
||||
use self::BinOp::*;
|
||||
matches!(self, Add | Sub | Mul | Shl | Shr)
|
||||
|
Loading…
Reference in New Issue
Block a user