From 77f92674f9a2ea8e8cd303d15710621a4f7839cb Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 26 Jan 2019 23:48:01 +0100 Subject: Handle cycles in type vars This might be the cause of #587. --- .../src/ty/snapshots/tests__recursive_vars.snap | 14 ++++++++++++++ .../src/ty/snapshots/tests__recursive_vars_2.snap | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 crates/ra_hir/src/ty/snapshots/tests__recursive_vars.snap create mode 100644 crates/ra_hir/src/ty/snapshots/tests__recursive_vars_2.snap (limited to 'crates/ra_hir/src/ty/snapshots') diff --git a/crates/ra_hir/src/ty/snapshots/tests__recursive_vars.snap b/crates/ra_hir/src/ty/snapshots/tests__recursive_vars.snap new file mode 100644 index 000000000..c3227ff7e --- /dev/null +++ b/crates/ra_hir/src/ty/snapshots/tests__recursive_vars.snap @@ -0,0 +1,14 @@ +--- +created: "2019-01-26T22:42:22.329980185+00:00" +creator: insta@0.5.2 +expression: "&result" +source: crates/ra_hir/src/ty/tests.rs +--- +[11; 48) '{ ...&y]; }': () +[21; 22) 'y': &[unknown] +[25; 32) 'unknown': &[unknown] +[38; 45) '[y, &y]': [&&[unknown]] +[39; 40) 'y': &[unknown] +[42; 44) '&y': &&[unknown] +[43; 44) 'y': &[unknown] + diff --git a/crates/ra_hir/src/ty/snapshots/tests__recursive_vars_2.snap b/crates/ra_hir/src/ty/snapshots/tests__recursive_vars_2.snap new file mode 100644 index 000000000..de124da5b --- /dev/null +++ b/crates/ra_hir/src/ty/snapshots/tests__recursive_vars_2.snap @@ -0,0 +1,21 @@ +--- +created: "2019-01-26T22:42:22.331805845+00:00" +creator: insta@0.5.2 +expression: "&result" +source: crates/ra_hir/src/ty/tests.rs +--- +[11; 80) '{ ...x)]; }': () +[21; 22) 'x': &&[unknown] +[25; 32) 'unknown': &&[unknown] +[42; 43) 'y': &&[unknown] +[46; 53) 'unknown': &&[unknown] +[59; 77) '[(x, y..., &x)]': [(&&[unknown], &&[unknown])] +[60; 66) '(x, y)': (&&[unknown], &&[unknown]) +[61; 62) 'x': &&[unknown] +[64; 65) 'y': &&[unknown] +[68; 76) '(&y, &x)': (&&&[unknown], &&&[unknown]) +[69; 71) '&y': &&&[unknown] +[70; 71) 'y': &&[unknown] +[73; 75) '&x': &&&[unknown] +[74; 75) 'x': &&[unknown] + -- cgit v1.2.3