diff options
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/marks.rs | 1 | ||||
-rw-r--r-- | 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 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::{ | |||
32 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; | 32 | use hir_expand::{diagnostics::DiagnosticSink, name::name}; |
33 | use ra_arena::map::ArenaMap; | 33 | use ra_arena::map::ArenaMap; |
34 | use ra_prof::profile; | 34 | use ra_prof::profile; |
35 | use test_utils::tested_by; | ||
35 | 36 | ||
36 | use super::{ | 37 | use 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 @@ | |||
1 | use super::{infer, infer_with_mismatches, type_at, type_at_pos}; | ||
2 | use crate::test_db::TestDB; | ||
3 | use insta::assert_snapshot; | 1 | use insta::assert_snapshot; |
2 | |||
4 | use ra_db::fixture::WithFixture; | 3 | use ra_db::fixture::WithFixture; |
4 | use test_utils::covers; | ||
5 | |||
6 | use super::{infer, infer_with_mismatches, type_at, type_at_pos}; | ||
7 | use crate::test_db::TestDB; | ||
5 | 8 | ||
6 | #[test] | 9 | #[test] |
7 | fn infer_await() { | 10 | fn 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] |
1491 | fn unify_impl_trait() { | 1494 | fn 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#" |
1494 | trait Trait<T> {} | 1498 | trait Trait<T> {} |