Reword note about missing trait implementation

This commit is contained in:
Florian Hahn 2015-10-12 00:25:50 +02:00
parent c154782435
commit b21ae1ab1a
2 changed files with 17 additions and 18 deletions

View File

@ -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);
}
}

View File

@ -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`
}