From 5227102c129fd6efe73a143e3dab25a6d267f3df Mon Sep 17 00:00:00 2001 From: kjeremy Date: Mon, 4 Feb 2019 14:44:06 -0500 Subject: Test more Self inference --- crates/ra_hir/src/ty/snapshots/tests__infer_self.snap | 10 +++++++--- crates/ra_hir/src/ty/tests.rs | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap index 84c8b1e90..5c927f5c1 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap @@ -1,8 +1,8 @@ --- -created: "2019-01-22T14:45:00.052694700+00:00" -creator: insta@0.4.0 +created: "2019-02-04T19:40:48.826936500+00:00" +creator: insta@0.5.3 expression: "&result" -source: "crates\\ra_hir\\src\\ty\\tests.rs" +source: crates/ra_hir/src/ty/tests.rs --- [34; 38) 'self': &S [40; 61) '{ ... }': () @@ -10,4 +10,8 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" [75; 79) 'self': &S [88; 109) '{ ... }': () [98; 102) 'self': &S +[133; 153) '{ ... }': S +[143; 147) 'S {}': S +[177; 200) '{ ... }': S +[187; 194) 'Self {}': S diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index cb8d6351d..30da8fc23 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -215,6 +215,12 @@ impl S { fn test2(self: &Self) { self; } + fn test3() -> Self { + S {} + } + fn test4() -> Self { + Self {} + } } "#, ); -- cgit v1.2.3