about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2015-10-12 00:25:50 +0200
committerFlorian Hahn <flo@fhahn.com>2015-10-13 09:59:46 +0200
commitb21ae1ab1ad582964c12136f645f80865a4c8d54 (patch)
treeb1b8f78b69d71f5f539850ff800fbbafdaad72e6
parentc154782435c9e4a9b737c14d8a8a402938a46df5 (diff)
downloadrust-b21ae1ab1ad582964c12136f645f80865a4c8d54.tar.gz
rust-b21ae1ab1ad582964c12136f645f80865a4c8d54.zip
Reword note about missing trait implementation
-rw-r--r--src/librustc_typeck/check/op.rs3
-rw-r--r--src/test/compile-fail/issue-28837.rs32
2 files changed, 17 insertions, 18 deletions
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`
 }