Restore note for PartialOrd and PartialEq

This commit is contained in:
LeSeulArtichaut 2019-12-10 22:51:47 +01:00
parent 3bd46f1aec
commit 27810e246c
1 changed files with 16 additions and 0 deletions

View File

@ -375,6 +375,22 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
(format!("no implementation for `{} >> {}", lhs_ty, rhs_ty),
Some("std::ops::Shr"))
},
hir::BinOpKind::Eq |
hir::BinOpKind::Ne => {
(format!(
"binary operation `{}` cannot be applied to type `{}`",
op.node.as_str(), lhs_ty),
Some("std::cmp::PartialEq"))
},
hir::BinOpKind::Lt |
hir::BinOpKind::Le |
hir::BinOpKind::Gt |
hir::BinOpKind::Ge => {
(format!(
"binary operation `{}` cannot be applied to type `{}`",
op.node.as_str(), lhs_ty),
Some("std::cmp::PartialOrd"))
}
_ => (format!(
"binary operation `{}` cannot be applied to type `{}`",
op.node.as_str(), lhs_ty),