Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't stutter in operator trait descriptions #40818

Merged
merged 1 commit into from
Mar 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub trait Drop {
fn drop(&mut self);
}

/// The `Add` trait is used to specify the functionality of `+`.
/// The addition operator `+`.
///
/// # Examples
///
Expand Down Expand Up @@ -269,7 +269,7 @@ macro_rules! add_impl {

add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Sub` trait is used to specify the functionality of `-`.
/// The subtraction operator `-`.
///
/// # Examples
///
Expand Down Expand Up @@ -342,7 +342,7 @@ macro_rules! sub_impl {

sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Mul` trait is used to specify the functionality of `*`.
/// The multiplication operator `*`.
///
/// # Examples
///
Expand Down Expand Up @@ -464,7 +464,7 @@ macro_rules! mul_impl {

mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Div` trait is used to specify the functionality of `/`.
/// The division operator `/`.
///
/// # Examples
///
Expand Down Expand Up @@ -609,7 +609,7 @@ macro_rules! div_impl_float {

div_impl_float! { f32 f64 }

/// The `Rem` trait is used to specify the functionality of `%`.
/// The remainder operator `%`.
///
/// # Examples
///
Expand Down Expand Up @@ -689,7 +689,7 @@ macro_rules! rem_impl_float {

rem_impl_float! { f32 f64 }

/// The `Neg` trait is used to specify the functionality of unary `-`.
/// The unary negation operator `-`.
///
/// # Examples
///
Expand Down Expand Up @@ -768,7 +768,7 @@ macro_rules! neg_impl_unsigned {
// neg_impl_unsigned! { usize u8 u16 u32 u64 }
neg_impl_numeric! { isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Not` trait is used to specify the functionality of unary `!`.
/// The unary logical negation operator `!`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the word “unary” really necessary here? Unlike - where there are binary and unary uses ! is always unary. Is the logical negation even defined in some other systems for multiple operands?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary, but I don't mind it either.

///
/// # Examples
///
Expand Down Expand Up @@ -826,7 +826,7 @@ macro_rules! not_impl {

not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitAnd` trait is used to specify the functionality of `&`.
/// The bitwise AND operator `&`.
///
/// # Examples
///
Expand Down Expand Up @@ -909,7 +909,7 @@ macro_rules! bitand_impl {

bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitOr` trait is used to specify the functionality of `|`.
/// The bitwise OR operator `|`.
///
/// # Examples
///
Expand Down Expand Up @@ -992,7 +992,7 @@ macro_rules! bitor_impl {

bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitXor` trait is used to specify the functionality of `^`.
/// The bitwise XOR operator `^`.
///
/// # Examples
///
Expand Down Expand Up @@ -1078,7 +1078,7 @@ macro_rules! bitxor_impl {

bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `Shl` trait is used to specify the functionality of `<<`.
/// The left shift operator `<<`.
///
/// # Examples
///
Expand Down Expand Up @@ -1181,7 +1181,7 @@ macro_rules! shl_impl_all {

shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }

/// The `Shr` trait is used to specify the functionality of `>>`.
/// The right shift operator `>>`.
///
/// # Examples
///
Expand Down Expand Up @@ -1284,7 +1284,7 @@ macro_rules! shr_impl_all {

shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }

/// The `AddAssign` trait is used to specify the functionality of `+=`.
/// The addition assignment operator `+=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1340,7 +1340,7 @@ macro_rules! add_assign_impl {

add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `SubAssign` trait is used to specify the functionality of `-=`.
/// The subtraction assignment operator `-=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1396,7 +1396,7 @@ macro_rules! sub_assign_impl {

sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `MulAssign` trait is used to specify the functionality of `*=`.
/// The multiplication assignment operator `*=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1441,7 +1441,7 @@ macro_rules! mul_assign_impl {

mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `DivAssign` trait is used to specify the functionality of `/=`.
/// The division assignment operator `/=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1485,7 +1485,7 @@ macro_rules! div_assign_impl {

div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `RemAssign` trait is used to specify the functionality of `%=`.
/// The remainder assignment operator `%=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1529,7 +1529,7 @@ macro_rules! rem_assign_impl {

rem_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `BitAndAssign` trait is used to specify the functionality of `&=`.
/// The bitwise AND assignment operator `&=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1615,7 +1615,7 @@ macro_rules! bitand_assign_impl {

bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitOrAssign` trait is used to specify the functionality of `|=`.
/// The bitwise OR assignment operator `|=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1659,7 +1659,7 @@ macro_rules! bitor_assign_impl {

bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitXorAssign` trait is used to specify the functionality of `^=`.
/// The bitwise XOR assignment operator `^=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1703,7 +1703,7 @@ macro_rules! bitxor_assign_impl {

bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `ShlAssign` trait is used to specify the functionality of `<<=`.
/// The left shift assignment operator `<<=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1768,7 +1768,7 @@ macro_rules! shl_assign_impl_all {

shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }

/// The `ShrAssign` trait is used to specify the functionality of `>>=`.
/// The right shift assignment operator `>>=`.
///
/// # Examples
///
Expand Down