Skip to content

Commit 0e9d1e1

Browse files
committed
binary operator overload type inference: add test mark
1 parent 4e49b2f commit 0e9d1e1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/hir_ty/src/infer/expr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use hir_def::{
1212
};
1313
use hir_expand::name::{name, Name};
1414
use syntax::ast::RangeOp;
15+
use test_utils::mark;
1516

1617
use crate::{
1718
autoderef, method_resolution, op,
@@ -537,6 +538,8 @@ impl<'a> InferenceContext<'a> {
537538
let ret = op::binary_op_return_ty(*op, lhs_ty.clone(), rhs_ty.clone());
538539

539540
if ret == Ty::Unknown {
541+
mark::hit!(infer_expr_inner_binary_operator_overload);
542+
540543
self.resolve_associated_type_with_params(
541544
lhs_ty,
542545
self.resolve_binary_op_output(op),

crates/hir_ty/src/tests/simple.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use expect_test::expect;
2+
use test_utils::mark;
23

34
use super::{check_infer, check_types};
45

@@ -2228,6 +2229,8 @@ fn generic_default_depending_on_other_type_arg_forward() {
22282229

22292230
#[test]
22302231
fn infer_operator_overload() {
2232+
mark::check!(infer_expr_inner_binary_operator_overload);
2233+
22312234
check_infer(
22322235
r#"
22332236
struct V2([f32; 2]);

0 commit comments

Comments
 (0)