Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/tests/method_resolution.rs')
-rw-r--r--crates/hir_ty/src/tests/method_resolution.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs
index 0c50227309..f8d7f2b642 100644
--- a/crates/hir_ty/src/tests/method_resolution.rs
+++ b/crates/hir_ty/src/tests/method_resolution.rs
@@ -37,6 +37,24 @@ fn infer_slice_method() {
}
#[test]
+fn infer_array_inherent_impl() {
+ check_types(
+ r#"
+ #[lang = "array"]
+ impl<T, const N: usize> [T; N] {
+ fn foo(&self) -> T {
+ loop {}
+ }
+ }
+ fn test(x: &[u8; 0]) {
+ <[_; 0]>::foo(x);
+ //^^^^^^^^^^^^^^^^ u8
+ }
+ "#,
+ );
+}
+
+#[test]
fn infer_associated_method_struct() {
check_infer(
r#"