Skip to content

Commit 6605d03

Browse files
authored
Rollup merge of rust-lang#48107 - matthiaskrgr:typo__substract_to_subtract, r=kennytm
fix typo: substract -> subtract
2 parents a37a329 + e6f910e commit 6605d03

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/libcore/ops/arith.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
181181
/// ```
182182
#[lang = "sub"]
183183
#[stable(feature = "rust1", since = "1.0.0")]
184-
#[rustc_on_unimplemented(message="cannot substract `{RHS}` from `{Self}`",
184+
#[rustc_on_unimplemented(message="cannot subtract `{RHS}` from `{Self}`",
185185
label="no implementation for `{Self} - {RHS}`")]
186186
pub trait Sub<RHS=Self> {
187187
/// 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 }
716716
/// ```
717717
#[lang = "sub_assign"]
718718
#[stable(feature = "op_assign_traits", since = "1.8.0")]
719-
#[rustc_on_unimplemented(message="cannot substract-assign `{Rhs}` from `{Self}`",
719+
#[rustc_on_unimplemented(message="cannot subtract-assign `{Rhs}` from `{Self}`",
720720
label="no implementation for `{Self} -= {Rhs}`")]
721721
pub trait SubAssign<Rhs=Self> {
722722
/// Performs the `-=` operation.

src/test/ui/mismatched_types/binops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
fn main() {
1212
1 + Some(1); //~ ERROR cannot add `std::option::Option<{integer}>` to `{integer}`
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`
1414
3 * (); //~ ERROR cannot multiply `()` to `{integer}`
1515
4 / ""; //~ ERROR cannot divide `{integer}` by `&str`
1616
5 < String::new(); //~ ERROR is not satisfied

src/test/ui/mismatched_types/binops.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ error[E0277]: cannot add `std::option::Option<{integer}>` to `{integer}`
66
|
77
= help: the trait `std::ops::Add<std::option::Option<{integer}>>` is not implemented for `{integer}`
88

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

0 commit comments

Comments
 (0)