Skip to content

Commit b21ae1a

Browse files
committed
Reword note about missing trait implementation
1 parent c154782 commit b21ae1a

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/librustc_typeck/check/op.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ fn check_overloaded_binop<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
209209

210210
if let Some(missing_trait) = missing_trait {
211211
span_note!(fcx.tcx().sess, lhs_expr.span,
212-
"an implementation of `{}` might be missing for `{}` \
213-
or one of its type arguments",
212+
"an implementation of `{}` might be missing for `{}`",
214213
missing_trait, lhs_ty);
215214
}
216215
}

src/test/compile-fail/issue-28837.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,48 @@ struct A;
1313
fn main() {
1414
let a = A;
1515

16-
a + a; //~ ERROR binary operation `+` cannot be applied to type `A`
17-
//~^ NOTE an implementation of `std::ops::Add` might be missing for `A` or
16+
a + a; //~ ERROR binary operation `+` cannot be applied to type `A`
17+
//~^ NOTE an implementation of `std::ops::Add` might be missing for `A`
1818

1919
a - a; //~ ERROR binary operation `-` cannot be applied to type `A`
20-
//~^ NOTE an implementation of `std::ops::Sub` might be missing for `A` or one of
20+
//~^ NOTE an implementation of `std::ops::Sub` might be missing for `A`
2121

2222
a * a; //~ ERROR binary operation `*` cannot be applied to type `A`
23-
//~^ NOTE an implementation of `std::ops::Mul` might be missing for `A` or one of
23+
//~^ NOTE an implementation of `std::ops::Mul` might be missing for `A`
2424

2525
a / a; //~ ERROR binary operation `/` cannot be applied to type `A`
26-
//~^ NOTE an implementation of `std::ops::Div` might be missing for `A` or one of
26+
//~^ NOTE an implementation of `std::ops::Div` might be missing for `A`
2727

2828
a % a; //~ ERROR binary operation `%` cannot be applied to type `A`
29-
//~^ NOTE an implementation of `std::ops::Rem` might be missing for `A` or one of
29+
//~^ NOTE an implementation of `std::ops::Rem` might be missing for `A`
3030

3131
a & a; //~ ERROR binary operation `&` cannot be applied to type `A`
32-
//~^ NOTE an implementation of `std::ops::BitAnd` might be missing for `A` or one of
32+
//~^ NOTE an implementation of `std::ops::BitAnd` might be missing for `A`
3333

3434
a | a; //~ ERROR binary operation `|` cannot be applied to type `A`
35-
//~^ NOTE an implementation of `std::ops::BitOr` might be missing for `A` or one of
35+
//~^ NOTE an implementation of `std::ops::BitOr` might be missing for `A`
3636

3737
a << a; //~ ERROR binary operation `<<` cannot be applied to type `A`
38-
//~^ NOTE an implementation of `std::ops::Shl` might be missing for `A` or one of
38+
//~^ NOTE an implementation of `std::ops::Shl` might be missing for `A`
3939

4040
a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A`
41-
//~^ NOTE an implementation of `std::ops::Shr` might be missing for `A` or one of
41+
//~^ NOTE an implementation of `std::ops::Shr` might be missing for `A`
4242

4343
a == a; //~ ERROR binary operation `==` cannot be applied to type `A`
44-
//~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of
44+
//~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A`
4545

4646
a != a; //~ ERROR binary operation `!=` cannot be applied to type `A`
47-
//~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of
47+
//~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A`
4848

4949
a < a; //~ ERROR binary operation `<` cannot be applied to type `A`
50-
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
50+
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A`
5151

5252
a <= a; //~ ERROR binary operation `<=` cannot be applied to type `A`
53-
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
53+
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A`
5454

5555
a > a; //~ ERROR binary operation `>` cannot be applied to type `A`
56-
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
56+
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A`
5757

5858
a >= a; //~ ERROR binary operation `>=` cannot be applied to type `A`
59-
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
59+
//~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A`
6060
}

0 commit comments

Comments
 (0)