diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index b00535c9610..0c65f68f02e 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -209,8 +209,7 @@ fn check_overloaded_binop<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, if let Some(missing_trait) = missing_trait { span_note!(fcx.tcx().sess, lhs_expr.span, - "an implementation of `{}` might be missing for `{}` \ - or one of its type arguments", + "an implementation of `{}` might be missing for `{}`", missing_trait, lhs_ty); } } diff --git a/src/test/compile-fail/issue-28837.rs b/src/test/compile-fail/issue-28837.rs index 6baaebc3244..c7cf63bf2c4 100644 --- a/src/test/compile-fail/issue-28837.rs +++ b/src/test/compile-fail/issue-28837.rs @@ -13,48 +13,48 @@ struct A; fn main() { let a = A; - a + a; //~ ERROR binary operation `+` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Add` might be missing for `A` or + a + a; //~ ERROR binary operation `+` cannot be applied to type `A` + //~^ NOTE an implementation of `std::ops::Add` might be missing for `A` a - a; //~ ERROR binary operation `-` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Sub` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::Sub` might be missing for `A` a * a; //~ ERROR binary operation `*` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Mul` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::Mul` might be missing for `A` a / a; //~ ERROR binary operation `/` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Div` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::Div` might be missing for `A` a % a; //~ ERROR binary operation `%` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Rem` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::Rem` might be missing for `A` a & a; //~ ERROR binary operation `&` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::BitAnd` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::BitAnd` might be missing for `A` a | a; //~ ERROR binary operation `|` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::BitOr` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::BitOr` might be missing for `A` a << a; //~ ERROR binary operation `<<` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Shl` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::Shl` might be missing for `A` a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A` - //~^ NOTE an implementation of `std::ops::Shr` might be missing for `A` or one of + //~^ NOTE an implementation of `std::ops::Shr` might be missing for `A` a == a; //~ ERROR binary operation `==` cannot be applied to type `A` - //~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of + //~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` a != a; //~ ERROR binary operation `!=` cannot be applied to type `A` - //~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of + //~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` a < a; //~ ERROR binary operation `<` cannot be applied to type `A` - //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` a <= a; //~ ERROR binary operation `<=` cannot be applied to type `A` - //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` a > a; //~ ERROR binary operation `>` cannot be applied to type `A` - //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` a >= a; //~ ERROR binary operation `>=` cannot be applied to type `A` - //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` }