diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r-- | crates/ra_hir_ty/src/tests/method_resolution.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/tests/traits.rs | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/tests/method_resolution.rs b/crates/ra_hir_ty/src/tests/method_resolution.rs index 45164c9e9..ce9a06fde 100644 --- a/crates/ra_hir_ty/src/tests/method_resolution.rs +++ b/crates/ra_hir_ty/src/tests/method_resolution.rs | |||
@@ -865,7 +865,7 @@ mod foo { | |||
865 | 865 | ||
866 | #[test] | 866 | #[test] |
867 | fn method_resolution_where_clause_for_unknown_trait() { | 867 | fn method_resolution_where_clause_for_unknown_trait() { |
868 | // The blanket impl shouldn't apply because we can't even resolve UnknownTrait | 868 | // The blanket impl currently applies because we ignore the unresolved where clause |
869 | let t = type_at( | 869 | let t = type_at( |
870 | r#" | 870 | r#" |
871 | //- /main.rs | 871 | //- /main.rs |
@@ -875,7 +875,7 @@ impl<T> Trait for T where T: UnknownTrait {} | |||
875 | fn test() { (&S).foo()<|>; } | 875 | fn test() { (&S).foo()<|>; } |
876 | "#, | 876 | "#, |
877 | ); | 877 | ); |
878 | assert_eq!(t, "{unknown}"); | 878 | assert_eq!(t, "u128"); |
879 | } | 879 | } |
880 | 880 | ||
881 | #[test] | 881 | #[test] |
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index 08d1bf044..0bc72644a 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs | |||
@@ -1016,6 +1016,23 @@ fn test() { | |||
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | #[test] | 1018 | #[test] |
1019 | fn error_bound_chalk() { | ||
1020 | let t = type_at( | ||
1021 | r#" | ||
1022 | //- /main.rs | ||
1023 | trait Trait { | ||
1024 | fn foo(&self) -> u32 {} | ||
1025 | } | ||
1026 | |||
1027 | fn test(x: (impl Trait + UnknownTrait)) { | ||
1028 | x.foo()<|>; | ||
1029 | } | ||
1030 | "#, | ||
1031 | ); | ||
1032 | assert_eq!(t, "u32"); | ||
1033 | } | ||
1034 | |||
1035 | #[test] | ||
1019 | fn assoc_type_bindings() { | 1036 | fn assoc_type_bindings() { |
1020 | assert_snapshot!( | 1037 | assert_snapshot!( |
1021 | infer(r#" | 1038 | infer(r#" |