Skip to content

Commit

Permalink
Reword note about missing trait implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
fhahn committed Oct 13, 2015
1 parent c154782 commit b21ae1a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/librustc_typeck/check/op.rs
Expand Up @@ -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);
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/test/compile-fail/issue-28837.rs
Expand Up @@ -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`
}

0 comments on commit b21ae1a

Please sign in to comment.