From c95bb0ba7b0dd1e5f86d5df532502744eabe92e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Rouill=C3=A9?= Date: Fri, 19 Jun 2020 20:33:04 +0200 Subject: Fix substs in resolve_value_path for ImplSelf Fixes #4953. --- crates/ra_hir_ty/src/tests/regression.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'crates/ra_hir_ty/src/tests/regression.rs') diff --git a/crates/ra_hir_ty/src/tests/regression.rs b/crates/ra_hir_ty/src/tests/regression.rs index 1f004bd63..ed43df484 100644 --- a/crates/ra_hir_ty/src/tests/regression.rs +++ b/crates/ra_hir_ty/src/tests/regression.rs @@ -633,3 +633,35 @@ where "### ); } + +#[test] +fn issue_4953() { + assert_snapshot!( + infer(r#" +pub struct Foo(pub i64); +impl Foo { + fn test() -> Self { Self(0i64) } +} +"#), + @r###" + 59..73 '{ Self(0i64) }': Foo + 61..65 'Self': Foo(i64) -> Foo + 61..71 'Self(0i64)': Foo + 66..70 '0i64': i64 + "### + ); + assert_snapshot!( + infer(r#" +pub struct Foo(pub T); +impl Foo { + fn test() -> Self { Self(0i64) } +} +"#), + @r###" + 65..79 '{ Self(0i64) }': Foo + 67..71 'Self': Foo(i64) -> Foo + 67..77 'Self(0i64)': Foo + 72..76 '0i64': i64 + "### + ); +} -- cgit v1.2.3