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

fix typo: substract -> subtract #48107

Merged
merged 1 commit into from
Feb 10, 2018
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/libcore/ops/arith.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "sub"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(message="cannot substract `{RHS}` from `{Self}`",
#[rustc_on_unimplemented(message="cannot subtract `{RHS}` from `{Self}`",
label="no implementation for `{Self} - {RHS}`")]
pub trait Sub<RHS=Self> {
/// The resulting type after applying the `-` operator.
Expand Down Expand Up @@ -716,7 +716,7 @@ add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "sub_assign"]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(message="cannot substract-assign `{Rhs}` from `{Self}`",
#[rustc_on_unimplemented(message="cannot subtract-assign `{Rhs}` from `{Self}`",
label="no implementation for `{Self} -= {Rhs}`")]
pub trait SubAssign<Rhs=Self> {
/// Performs the `-=` operation.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mismatched_types/binops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

fn main() {
1 + Some(1); //~ ERROR cannot add `std::option::Option<{integer}>` to `{integer}`
2 as usize - Some(1); //~ ERROR cannot substract `std::option::Option<{integer}>` from `usize`
2 as usize - Some(1); //~ ERROR cannot subtract `std::option::Option<{integer}>` from `usize`
3 * (); //~ ERROR cannot multiply `()` to `{integer}`
4 / ""; //~ ERROR cannot divide `{integer}` by `&str`
5 < String::new(); //~ ERROR is not satisfied
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/mismatched_types/binops.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ error[E0277]: cannot add `std::option::Option<{integer}>` to `{integer}`
|
= help: the trait `std::ops::Add<std::option::Option<{integer}>>` is not implemented for `{integer}`

error[E0277]: cannot substract `std::option::Option<{integer}>` from `usize`
error[E0277]: cannot subtract `std::option::Option<{integer}>` from `usize`
--> $DIR/binops.rs:13:16
|
13 | 2 as usize - Some(1); //~ ERROR cannot substract `std::option::Option<{integer}>` from `usize`
13 | 2 as usize - Some(1); //~ ERROR cannot subtract `std::option::Option<{integer}>` from `usize`
| ^ no implementation for `usize - std::option::Option<{integer}>`
|
= help: the trait `std::ops::Sub<std::option::Option<{integer}>>` is not implemented for `usize`
Expand Down