aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r--crates/ra_hir_ty/src/tests/method_resolution.rs18
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]
842fn method_resolution_unsize_array() {
843 let t = type_at(
844 r#"
845//- /main.rs
846#[lang = "slice"]
847impl<T> [T] {
848 fn len(&self) -> usize { loop {} }
849}
850fn test() {
851 let a = [1, 2, 3];
852 a.len()<|>;
853}
854"#,
855 );
856 assert_eq!(t, "usize");
857}
858
859#[test]
842fn method_resolution_trait_from_prelude() { 860fn method_resolution_trait_from_prelude() {
843 let (db, pos) = TestDB::with_position( 861 let (db, pos) = TestDB::with_position(
844 r#" 862 r#"