From 27810e246c89777f39441d6cc050e540cb2e54e0 Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Tue, 10 Dec 2019 22:51:47 +0100 Subject: [PATCH] Restore note for PartialOrd and PartialEq --- src/librustc_typeck/check/op.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 2e56048fc0e..5fa6bdf2ee3 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -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),