about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/hir_ty/src/infer/expr.rs3
-rw-r--r--crates/hir_ty/src/tests/simple.rs3
2 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs
index 8cc0d56d300..8ac4cf89a0c 100644
--- a/crates/hir_ty/src/infer/expr.rs
+++ b/crates/hir_ty/src/infer/expr.rs
@@ -12,6 +12,7 @@ use hir_def::{
 };
 use hir_expand::name::{name, Name};
 use syntax::ast::RangeOp;
+use test_utils::mark;
 
 use crate::{
     autoderef, method_resolution, op,
@@ -537,6 +538,8 @@ impl<'a> InferenceContext<'a> {
                     let ret = op::binary_op_return_ty(*op, lhs_ty.clone(), rhs_ty.clone());
 
                     if ret == Ty::Unknown {
+                        mark::hit!(infer_expr_inner_binary_operator_overload);
+
                         self.resolve_associated_type_with_params(
                             lhs_ty,
                             self.resolve_binary_op_output(op),
diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs
index a3ae304a1a9..4f72582b6bd 100644
--- a/crates/hir_ty/src/tests/simple.rs
+++ b/crates/hir_ty/src/tests/simple.rs
@@ -1,4 +1,5 @@
 use expect_test::expect;
+use test_utils::mark;
 
 use super::{check_infer, check_types};
 
@@ -2228,6 +2229,8 @@ fn generic_default_depending_on_other_type_arg_forward() {
 
 #[test]
 fn infer_operator_overload() {
+    mark::check!(infer_expr_inner_binary_operator_overload);
+
     check_infer(
         r#"
         struct V2([f32; 2]);