Skip to content

Commit 27810e2

Browse files
Restore note for PartialOrd and PartialEq
1 parent 3bd46f1 commit 27810e2

File tree

1 file changed

+16
-0
lines changed
  • src/librustc_typeck/check

1 file changed

+16
-0
lines changed

src/librustc_typeck/check/op.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,22 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
375375
(format!("no implementation for `{} >> {}", lhs_ty, rhs_ty),
376376
Some("std::ops::Shr"))
377377
},
378+
hir::BinOpKind::Eq |
379+
hir::BinOpKind::Ne => {
380+
(format!(
381+
"binary operation `{}` cannot be applied to type `{}`",
382+
op.node.as_str(), lhs_ty),
383+
Some("std::cmp::PartialEq"))
384+
},
385+
hir::BinOpKind::Lt |
386+
hir::BinOpKind::Le |
387+
hir::BinOpKind::Gt |
388+
hir::BinOpKind::Ge => {
389+
(format!(
390+
"binary operation `{}` cannot be applied to type `{}`",
391+
op.node.as_str(), lhs_ty),
392+
Some("std::cmp::PartialOrd"))
393+
}
378394
_ => (format!(
379395
"binary operation `{}` cannot be applied to type `{}`",
380396
op.node.as_str(), lhs_ty),

0 commit comments

Comments
 (0)