aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-12-15 20:06:08 +0000
committerFlorian Diebold <[email protected]>2019-12-15 20:06:08 +0000
commit91853590a9ee78406e892ca92305edef3a5b9213 (patch)
tree911458abbefcddd06e131c410bd1e1710e77ca95
parent6e1c2d0df89a390be33c81b6e03a5ad352763593 (diff)
Add test mark
-rw-r--r--crates/ra_hir_ty/src/infer.rs2
-rw-r--r--crates/ra_hir_ty/src/marks.rs1
-rw-r--r--crates/ra_hir_ty/src/tests/traits.rs8
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 1aa1330a6..98ba05fc2 100644
--- a/crates/ra_hir_ty/src/infer.rs
+++ b/crates/ra_hir_ty/src/infer.rs
@@ -32,6 +32,7 @@ use hir_def::{
32use hir_expand::{diagnostics::DiagnosticSink, name::name}; 32use hir_expand::{diagnostics::DiagnosticSink, name::name};
33use ra_arena::map::ArenaMap; 33use ra_arena::map::ArenaMap;
34use ra_prof::profile; 34use ra_prof::profile;
35use test_utils::tested_by;
35 36
36use super::{ 37use super::{
37 primitive::{FloatTy, IntTy}, 38 primitive::{FloatTy, IntTy},
@@ -282,6 +283,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
282 fn insert_vars_for_impl_trait(&mut self, ty: Ty) -> Ty { 283 fn insert_vars_for_impl_trait(&mut self, ty: Ty) -> Ty {
283 ty.fold(&mut |ty| match ty { 284 ty.fold(&mut |ty| match ty {
284 Ty::Opaque(preds) => { 285 Ty::Opaque(preds) => {
286 tested_by!(insert_vars_for_impl_trait);
285 let var = self.table.new_type_var(); 287 let var = self.table.new_type_var();
286 let var_subst = Substs::builder(1).push(var.clone()).build(); 288 let var_subst = Substs::builder(1).push(var.clone()).build();
287 self.obligations.extend( 289 self.obligations.extend(
diff --git a/crates/ra_hir_ty/src/marks.rs b/crates/ra_hir_ty/src/marks.rs
index 0f754eb9c..fe74acf11 100644
--- a/crates/ra_hir_ty/src/marks.rs
+++ b/crates/ra_hir_ty/src/marks.rs
@@ -6,4 +6,5 @@ test_utils::marks!(
6 type_var_resolves_to_int_var 6 type_var_resolves_to_int_var
7 match_ergonomics_ref 7 match_ergonomics_ref
8 coerce_merge_fail_fallback 8 coerce_merge_fail_fallback
9 insert_vars_for_impl_trait
9); 10);
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs
index d8673c90d..802937cb0 100644
--- a/crates/ra_hir_ty/src/tests/traits.rs
+++ b/crates/ra_hir_ty/src/tests/traits.rs
@@ -1,7 +1,10 @@
1use super::{infer, infer_with_mismatches, type_at, type_at_pos};
2use crate::test_db::TestDB;
3use insta::assert_snapshot; 1use insta::assert_snapshot;
2
4use ra_db::fixture::WithFixture; 3use ra_db::fixture::WithFixture;
4use test_utils::covers;
5
6use super::{infer, infer_with_mismatches, type_at, type_at_pos};
7use crate::test_db::TestDB;
5 8
6#[test] 9#[test]
7fn infer_await() { 10fn infer_await() {
@@ -1489,6 +1492,7 @@ fn test<T, U>() where T: Trait<U::Item>, U: Trait<T::Item> {
1489 1492
1490#[test] 1493#[test]
1491fn unify_impl_trait() { 1494fn unify_impl_trait() {
1495 covers!(insert_vars_for_impl_trait);
1492 assert_snapshot!( 1496 assert_snapshot!(
1493 infer_with_mismatches(r#" 1497 infer_with_mismatches(r#"
1494trait Trait<T> {} 1498trait Trait<T> {}