diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests/method_resolution.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/method_resolution.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/method_resolution.rs b/crates/ra_hir_ty/src/tests/method_resolution.rs index 644d59e17..f9b394f05 100644 --- a/crates/ra_hir_ty/src/tests/method_resolution.rs +++ b/crates/ra_hir_ty/src/tests/method_resolution.rs | |||
@@ -839,6 +839,24 @@ fn test() { (&S).foo()<|>; } | |||
839 | } | 839 | } |
840 | 840 | ||
841 | #[test] | 841 | #[test] |
842 | fn method_resolution_unsize_array() { | ||
843 | let t = type_at( | ||
844 | r#" | ||
845 | //- /main.rs | ||
846 | #[lang = "slice"] | ||
847 | impl<T> [T] { | ||
848 | fn len(&self) -> usize { loop {} } | ||
849 | } | ||
850 | fn test() { | ||
851 | let a = [1, 2, 3]; | ||
852 | a.len()<|>; | ||
853 | } | ||
854 | "#, | ||
855 | ); | ||
856 | assert_eq!(t, "usize"); | ||
857 | } | ||
858 | |||
859 | #[test] | ||
842 | fn method_resolution_trait_from_prelude() { | 860 | fn method_resolution_trait_from_prelude() { |
843 | let (db, pos) = TestDB::with_position( | 861 | let (db, pos) = TestDB::with_position( |
844 | r#" | 862 | r#" |