aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2020-02-07 14:13:00 +0000
committerFlorian Diebold <[email protected]>2020-02-07 17:28:10 +0000
commit6787f124b5557120cd1e4557cbdb59aa7f215be6 (patch)
tree810aa041297e9ff450dbb3a8a05f09a10c08f8a2 /crates/ra_hir_ty/src/tests
parent0718682cffaae34e5c106c793c60f6706fc04b05 (diff)
Clean up RPIT a bit
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r--crates/ra_hir_ty/src/tests/traits.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs
index bae5eae07..134cea8d8 100644
--- a/crates/ra_hir_ty/src/tests/traits.rs
+++ b/crates/ra_hir_ty/src/tests/traits.rs
@@ -1,7 +1,6 @@
1use insta::assert_snapshot; 1use insta::assert_snapshot;
2 2
3use ra_db::fixture::WithFixture; 3use ra_db::fixture::WithFixture;
4use test_utils::covers;
5 4
6use super::{infer, infer_with_mismatches, type_at, type_at_pos}; 5use super::{infer, infer_with_mismatches, type_at, type_at_pos};
7use crate::test_db::TestDB; 6use crate::test_db::TestDB;
@@ -1650,7 +1649,6 @@ fn test<T, U>() where T: Trait<U::Item>, U: Trait<T::Item> {
1650 1649
1651#[test] 1650#[test]
1652fn unify_impl_trait() { 1651fn unify_impl_trait() {
1653 covers!(insert_vars_for_impl_trait);
1654 assert_snapshot!( 1652 assert_snapshot!(
1655 infer_with_mismatches(r#" 1653 infer_with_mismatches(r#"
1656trait Trait<T> {} 1654trait Trait<T> {}
@@ -1682,26 +1680,26 @@ fn test() -> impl Trait<i32> {
1682 [172; 183) '{ loop {} }': T 1680 [172; 183) '{ loop {} }': T
1683 [174; 181) 'loop {}': ! 1681 [174; 181) 'loop {}': !
1684 [179; 181) '{}': () 1682 [179; 181) '{}': ()
1685 [214; 310) '{ ...t()) }': S<i32> 1683 [214; 310) '{ ...t()) }': S<{unknown}>
1686 [224; 226) 's1': S<u32> 1684 [224; 226) 's1': S<u32>
1687 [229; 230) 'S': S<u32>(T) -> S<T> 1685 [229; 230) 'S': S<u32>(u32) -> S<u32>
1688 [229; 241) 'S(default())': S<u32> 1686 [229; 241) 'S(default())': S<u32>
1689 [231; 238) 'default': fn default<u32>() -> T 1687 [231; 238) 'default': fn default<u32>() -> u32
1690 [231; 240) 'default()': u32 1688 [231; 240) 'default()': u32
1691 [247; 250) 'foo': fn foo(impl Trait<u32>) -> () 1689 [247; 250) 'foo': fn foo<S<u32>>(S<u32>) -> ()
1692 [247; 254) 'foo(s1)': () 1690 [247; 254) 'foo(s1)': ()
1693 [251; 253) 's1': S<u32> 1691 [251; 253) 's1': S<u32>
1694 [264; 265) 'x': i32 1692 [264; 265) 'x': i32
1695 [273; 276) 'bar': fn bar<i32>(impl Trait<T>) -> T 1693 [273; 276) 'bar': fn bar<i32, S<i32>>(S<i32>) -> i32
1696 [273; 290) 'bar(S(...lt()))': i32 1694 [273; 290) 'bar(S(...lt()))': i32
1697 [277; 278) 'S': S<i32>(T) -> S<T> 1695 [277; 278) 'S': S<i32>(i32) -> S<i32>
1698 [277; 289) 'S(default())': S<i32> 1696 [277; 289) 'S(default())': S<i32>
1699 [279; 286) 'default': fn default<i32>() -> T 1697 [279; 286) 'default': fn default<i32>() -> i32
1700 [279; 288) 'default()': i32 1698 [279; 288) 'default()': i32
1701 [296; 297) 'S': S<i32>(T) -> S<T> 1699 [296; 297) 'S': S<{unknown}>({unknown}) -> S<{unknown}>
1702 [296; 308) 'S(default())': S<i32> 1700 [296; 308) 'S(default())': S<{unknown}>
1703 [298; 305) 'default': fn default<i32>() -> T 1701 [298; 305) 'default': fn default<{unknown}>() -> {unknown}
1704 [298; 307) 'default()': i32 1702 [298; 307) 'default()': {unknown}
1705 "### 1703 "###
1706 ); 1704 );
1707} 1705}