From fc9eed4836dfc88fe2893c81b015ab440cea2ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 8 Mar 2021 22:19:44 +0200 Subject: Use upstream cov-mark --- crates/hir_ty/src/infer/coerce.rs | 5 ++--- crates/hir_ty/src/infer/expr.rs | 3 +-- crates/hir_ty/src/infer/pat.rs | 3 +-- crates/hir_ty/src/infer/unify.rs | 8 +++----- 4 files changed, 7 insertions(+), 12 deletions(-) (limited to 'crates/hir_ty/src/infer') diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index cf0a3add4..7e8846f27 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -6,7 +6,6 @@ use chalk_ir::{Mutability, TyVariableKind}; use hir_def::lang_item::LangItemTarget; -use test_utils::mark; use crate::{autoderef, traits::Solution, Obligation, Substs, TraitRef, Ty}; @@ -35,7 +34,7 @@ impl<'a> InferenceContext<'a> { ty1.clone() } else { if let (Ty::FnDef(..), Ty::FnDef(..)) = (ty1, ty2) { - mark::hit!(coerce_fn_reification); + cov_mark::hit!(coerce_fn_reification); // Special case: two function types. Try to coerce both to // pointers to have a chance at getting a match. See // https://github.com/rust-lang/rust/blob/7b805396bf46dce972692a6846ce2ad8481c5f85/src/librustc_typeck/check/coercion.rs#L877-L916 @@ -45,7 +44,7 @@ impl<'a> InferenceContext<'a> { let ptr_ty2 = Ty::fn_ptr(sig2); self.coerce_merge_branch(&ptr_ty1, &ptr_ty2) } else { - mark::hit!(coerce_merge_fail_fallback); + cov_mark::hit!(coerce_merge_fail_fallback); ty1.clone() } } diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index ec2c13154..262177ffb 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -12,7 +12,6 @@ use hir_def::{ }; use hir_expand::name::{name, Name}; use syntax::ast::RangeOp; -use test_utils::mark; use crate::{ autoderef, @@ -565,7 +564,7 @@ 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); + cov_mark::hit!(infer_expr_inner_binary_operator_overload); self.resolve_associated_type_with_params( lhs_ty, diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index 987793e2e..a0ac8d80f 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -10,7 +10,6 @@ use hir_def::{ FieldId, }; use hir_expand::name::Name; -use test_utils::mark; use super::{BindingMode, Expectation, InferenceContext}; use crate::{lower::lower_to_chalk_mutability, utils::variant_data, Substs, Ty}; @@ -108,7 +107,7 @@ impl<'a> InferenceContext<'a> { } } } else if let Pat::Ref { .. } = &body[pat] { - mark::hit!(match_ergonomics_ref); + cov_mark::hit!(match_ergonomics_ref); // When you encounter a `&pat` pattern, reset to Move. // This is so that `w` is by value: `let (_, &w) = &(1, &2);` default_bm = BindingMode::Move; diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 99a89a7f3..54fcfed10 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -5,8 +5,6 @@ use std::borrow::Cow; use chalk_ir::{FloatTy, IntTy, TyVariableKind}; use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; -use test_utils::mark; - use super::{InferenceContext, Obligation}; use crate::{ BoundVar, Canonical, DebruijnIndex, GenericPredicate, InEnvironment, InferenceVar, Scalar, @@ -387,7 +385,7 @@ impl InferenceTable { // more than once for i in 0..3 { if i > 0 { - mark::hit!(type_var_resolves_to_int_var); + cov_mark::hit!(type_var_resolves_to_int_var); } match &*ty { Ty::InferenceVar(tv, _) => { @@ -416,7 +414,7 @@ impl InferenceTable { Ty::InferenceVar(tv, kind) => { let inner = tv.to_inner(); if tv_stack.contains(&inner) { - mark::hit!(type_var_cycles_resolve_as_possible); + cov_mark::hit!(type_var_cycles_resolve_as_possible); // recursive type return self.type_variable_table.fallback_value(tv, kind); } @@ -443,7 +441,7 @@ impl InferenceTable { Ty::InferenceVar(tv, kind) => { let inner = tv.to_inner(); if tv_stack.contains(&inner) { - mark::hit!(type_var_cycles_resolve_completely); + cov_mark::hit!(type_var_cycles_resolve_completely); // recursive type return self.type_variable_table.fallback_value(tv, kind); } -- cgit v1.2.3