From 91853590a9ee78406e892ca92305edef3a5b9213 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 15 Dec 2019 21:06:08 +0100 Subject: [PATCH] Add test mark --- crates/ra_hir_ty/src/infer.rs | 2 ++ crates/ra_hir_ty/src/marks.rs | 1 + crates/ra_hir_ty/src/tests/traits.rs | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 1aa1330a6c..98ba05fc27 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs @@ -32,6 +32,7 @@ use hir_def::{ use hir_expand::{diagnostics::DiagnosticSink, name::name}; use ra_arena::map::ArenaMap; use ra_prof::profile; +use test_utils::tested_by; use super::{ primitive::{FloatTy, IntTy}, @@ -282,6 +283,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { fn insert_vars_for_impl_trait(&mut self, ty: Ty) -> Ty { ty.fold(&mut |ty| match ty { Ty::Opaque(preds) => { + tested_by!(insert_vars_for_impl_trait); let var = self.table.new_type_var(); let var_subst = Substs::builder(1).push(var.clone()).build(); self.obligations.extend( diff --git a/crates/ra_hir_ty/src/marks.rs b/crates/ra_hir_ty/src/marks.rs index 0f754eb9c7..fe74acf119 100644 --- a/crates/ra_hir_ty/src/marks.rs +++ b/crates/ra_hir_ty/src/marks.rs @@ -6,4 +6,5 @@ test_utils::marks!( type_var_resolves_to_int_var match_ergonomics_ref coerce_merge_fail_fallback + insert_vars_for_impl_trait ); diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index d8673c90d3..802937cb02 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs @@ -1,7 +1,10 @@ +use insta::assert_snapshot; + +use ra_db::fixture::WithFixture; +use test_utils::covers; + use super::{infer, infer_with_mismatches, type_at, type_at_pos}; use crate::test_db::TestDB; -use insta::assert_snapshot; -use ra_db::fixture::WithFixture; #[test] fn infer_await() { @@ -1489,6 +1492,7 @@ fn test() where T: Trait, U: Trait { #[test] fn unify_impl_trait() { + covers!(insert_vars_for_impl_trait); assert_snapshot!( infer_with_mismatches(r#" trait Trait {}