about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-02-10 14:24:10 +0800
committerGitHub <noreply@github.com>2018-02-10 14:24:10 +0800
commit6605d0354996b1301d69c55ad4fa114f7437f7cf (patch)
tree793cf6e3d17ec554c0bd5d805c555591de877c55
parenta37a3295221b55a50147373ad84f588e8760da4d (diff)
parente6f910e31e578301cc8608f049f1763172569ca8 (diff)
downloadrust-6605d0354996b1301d69c55ad4fa114f7437f7cf.tar.gz
rust-6605d0354996b1301d69c55ad4fa114f7437f7cf.zip
Rollup merge of #48107 - matthiaskrgr:typo__substract_to_subtract, r=kennytm
fix typo: substract -> subtract
-rw-r--r--src/libcore/ops/arith.rs4
-rw-r--r--src/test/ui/mismatched_types/binops.rs2
-rw-r--r--src/test/ui/mismatched_types/binops.stderr4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/ops/arith.rs b/src/libcore/ops/arith.rs
index d0d0c09869e..88db019b02f 100644
--- a/src/libcore/ops/arith.rs
+++ b/src/libcore/ops/arith.rs
@@ -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.
@@ -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.
diff --git a/src/test/ui/mismatched_types/binops.rs b/src/test/ui/mismatched_types/binops.rs
index 5144b59955c..3f2cb59b11d 100644
--- a/src/test/ui/mismatched_types/binops.rs
+++ b/src/test/ui/mismatched_types/binops.rs
@@ -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
diff --git a/src/test/ui/mismatched_types/binops.stderr b/src/test/ui/mismatched_types/binops.stderr
index 1b7fba05063..828cf636951 100644
--- a/src/test/ui/mismatched_types/binops.stderr
+++ b/src/test/ui/mismatched_types/binops.stderr
@@ -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`