aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLenard Pratt <[email protected]>2019-04-03 23:23:58 +0100
committerLenard Pratt <[email protected]>2019-04-07 13:23:12 +0100
commit2d73c909fe03c799b488aa0f97a588e13bbd7006 (patch)
treeb96bf7ccc6cc6e0ebb86e52ffad104f44f53d556 /crates
parent36f5d997565b6390a4b524e7e1d0d805f0f26bdb (diff)
Added inference of array length
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/expr.rs15
-rw-r--r--crates/ra_hir/src/ty.rs6
-rw-r--r--crates/ra_hir/src/ty/.tests.rs.pending-snap28
-rw-r--r--crates/ra_hir/src/ty/infer.rs11
-rw-r--r--crates/ra_syntax/src/ast/generated.rs4
-rw-r--r--crates/ra_syntax/src/grammar.ron3
6 files changed, 62 insertions, 5 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index cfa824458..3e6578651 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -240,6 +240,7 @@ pub enum Expr {
240 }, 240 },
241 Array { 241 Array {
242 exprs: Vec<ExprId>, 242 exprs: Vec<ExprId>,
243 repeat: Option<ExprId>,
243 }, 244 },
244 Literal(Literal), 245 Literal(Literal),
245} 246}
@@ -348,11 +349,20 @@ impl Expr {
348 | Expr::UnaryOp { expr, .. } => { 349 | Expr::UnaryOp { expr, .. } => {
349 f(*expr); 350 f(*expr);
350 } 351 }
351 Expr::Tuple { exprs } | Expr::Array { exprs } => { 352 Expr::Tuple { exprs } => {
352 for expr in exprs { 353 for expr in exprs {
353 f(*expr); 354 f(*expr);
354 } 355 }
355 } 356 }
357 Expr::Array { exprs, repeat } => {
358 for expr in exprs {
359 f(*expr);
360 }
361
362 if let Some(expr) = repeat {
363 f(*expr)
364 }
365 }
356 Expr::Literal(_) => {} 366 Expr::Literal(_) => {}
357 } 367 }
358 } 368 }
@@ -725,7 +735,8 @@ impl ExprCollector {
725 } 735 }
726 ast::ExprKind::ArrayExpr(e) => { 736 ast::ExprKind::ArrayExpr(e) => {
727 let exprs = e.exprs().map(|expr| self.collect_expr(expr)).collect(); 737 let exprs = e.exprs().map(|expr| self.collect_expr(expr)).collect();
728 self.alloc_expr(Expr::Array { exprs }, syntax_ptr) 738 let repeat = e.repeat().map(|e| self.collect_expr(e));
739 self.alloc_expr(Expr::Array { exprs, repeat }, syntax_ptr)
729 } 740 }
730 ast::ExprKind::Literal(e) => { 741 ast::ExprKind::Literal(e) => {
731 let lit = match e.kind() { 742 let lit = match e.kind() {
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index d42c61e9d..77690309a 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -353,10 +353,14 @@ impl HirDisplay for ApplicationTy {
353 TypeCtor::Int(t) => write!(f, "{}", t)?, 353 TypeCtor::Int(t) => write!(f, "{}", t)?,
354 TypeCtor::Float(t) => write!(f, "{}", t)?, 354 TypeCtor::Float(t) => write!(f, "{}", t)?,
355 TypeCtor::Str => write!(f, "str")?, 355 TypeCtor::Str => write!(f, "str")?,
356 TypeCtor::Slice | TypeCtor::Array => { 356 TypeCtor::Slice => {
357 let t = self.parameters.as_single(); 357 let t = self.parameters.as_single();
358 write!(f, "[{}]", t.display(f.db))?; 358 write!(f, "[{}]", t.display(f.db))?;
359 } 359 }
360 TypeCtor::Array => {
361 let t = self.parameters.as_single();
362 write!(f, "[{};usize]", t.display(f.db))?;
363 }
360 TypeCtor::RawPtr(m) => { 364 TypeCtor::RawPtr(m) => {
361 let t = self.parameters.as_single(); 365 let t = self.parameters.as_single();
362 write!(f, "*{}{}", m.as_keyword_for_ptr(), t.display(f.db))?; 366 write!(f, "*{}{}", m.as_keyword_for_ptr(), t.display(f.db))?;
diff --git a/crates/ra_hir/src/ty/.tests.rs.pending-snap b/crates/ra_hir/src/ty/.tests.rs.pending-snap
new file mode 100644
index 000000000..7c7e825fd
--- /dev/null
+++ b/crates/ra_hir/src/ty/.tests.rs.pending-snap
@@ -0,0 +1,28 @@
1{"run_id":"a9369f17-d487-4cdb-8762-6d57bb38dfd6","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:49:23.327579Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
2{"run_id":"a9369f17-d487-4cdb-8762-6d57bb38dfd6","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:49:23.380284Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
3{"run_id":"a9369f17-d487-4cdb-8762-6d57bb38dfd6","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:49:23.280012Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
4{"run_id":"a9369f17-d487-4cdb-8762-6d57bb38dfd6","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:49:23.362700Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
5{"run_id":"be772ce1-85a5-4a66-9759-d2f2ec500485","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:53:07.383521Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown},usize]\n[39; 40) 'y': &{unknown}\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
6{"run_id":"be772ce1-85a5-4a66-9759-d2f2ec500485","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:53:07.344395Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8,usize]\n[30; 50) '[0, b'...b'\\n']': [u8,usize]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
7{"run_id":"be772ce1-85a5-4a66-9759-d2f2ec500485","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:53:07.386674Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown}),usize]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
8{"run_id":"be772ce1-85a5-4a66-9759-d2f2ec500485","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:53:07.295710Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str,usize]\n[42; 45) '[x]': [&str,usize]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str,usize],usize]\n[59; 65) '[a, a]': [[&str,usize],usize]\n[60; 61) 'a': [&str,usize]\n[60; 61) 'a': [&str,usize]\n[63; 64) 'a': [&str,usize]\n[75; 76) 'c': [[[&str,usize],usize],usize]\n[79; 85) '[b, b]': [[[&str,usize],usize],usize]\n[80; 81) 'b': [[&str,usize],usize]\n[80; 81) 'b': [[&str,usize],usize]\n[83; 84) 'b': [[&str,usize],usize]\n[96; 97) 'd': [isize,usize]\n[100; 112) '[y, 1, 2, 3]': [isize,usize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize,usize]\n[126; 138) '[1, y, 2, 3]': [isize,usize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize,usize]\n[152; 155) '[y]': [isize,usize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize,usize],usize]\n[169; 175) '[d, d]': [[isize,usize],usize]\n[170; 171) 'd': [isize,usize]\n[170; 171) 'd': [isize,usize]\n[173; 174) 'd': [isize,usize]\n[185; 186) 'g': [[isize,usize],usize]\n[189; 195) '[e, e]': [[isize,usize],usize]\n[190; 191) 'e': [isize,usize]\n[190; 191) 'e': [isize,usize]\n[193; 194) 'e': [isize,usize]\n[206; 207) 'h': [i32,usize]\n[210; 216) '[1, 2]': [i32,usize]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str,usize]\n[230; 240) '[\"a\", \"b\"]': [&str,usize]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str,usize],usize]\n[255; 265) '[a, [\"b\"]]': [[&str,usize],usize]\n[256; 257) 'a': [&str,usize]\n[256; 257) 'a': [&str,usize]\n[259; 264) '[\"b\"]': [&str,usize]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8,usize]\n[288; 290) '[]': [u8,usize]\n[300; 301) 'z': &[u8,usize]\n[311; 321) '&[1, 2, 3]': &[u8,usize]\n[312; 321) '[1, 2, 3]': [u8,usize]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
9{"run_id":"4d89ad2b-517f-40ee-a338-ac0fb94c41c3","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:54:08.012093Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8;usize]\n[30; 50) '[0, b'...b'\\n']': [u8;usize]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
10{"run_id":"4d89ad2b-517f-40ee-a338-ac0fb94c41c3","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:54:07.959973Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str;usize]\n[42; 45) '[x]': [&str;usize]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str;usize];usize]\n[59; 65) '[a, a]': [[&str;usize];usize]\n[60; 61) 'a': [&str;usize]\n[60; 61) 'a': [&str;usize]\n[63; 64) 'a': [&str;usize]\n[75; 76) 'c': [[[&str;usize];usize];usize]\n[79; 85) '[b, b]': [[[&str;usize];usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[83; 84) 'b': [[&str;usize];usize]\n[96; 97) 'd': [isize;usize]\n[100; 112) '[y, 1, 2, 3]': [isize;usize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize;usize]\n[126; 138) '[1, y, 2, 3]': [isize;usize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize;usize]\n[152; 155) '[y]': [isize;usize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize;usize];usize]\n[169; 175) '[d, d]': [[isize;usize];usize]\n[170; 171) 'd': [isize;usize]\n[170; 171) 'd': [isize;usize]\n[173; 174) 'd': [isize;usize]\n[185; 186) 'g': [[isize;usize];usize]\n[189; 195) '[e, e]': [[isize;usize];usize]\n[190; 191) 'e': [isize;usize]\n[190; 191) 'e': [isize;usize]\n[193; 194) 'e': [isize;usize]\n[206; 207) 'h': [i32;usize]\n[210; 216) '[1, 2]': [i32;usize]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str;usize]\n[230; 240) '[\"a\", \"b\"]': [&str;usize]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str;usize];usize]\n[255; 265) '[a, [\"b\"]]': [[&str;usize];usize]\n[256; 257) 'a': [&str;usize]\n[256; 257) 'a': [&str;usize]\n[259; 264) '[\"b\"]': [&str;usize]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8;usize]\n[288; 290) '[]': [u8;usize]\n[300; 301) 'z': &[u8;usize]\n[311; 321) '&[1, 2, 3]': &[u8;usize]\n[312; 321) '[1, 2, 3]': [u8;usize]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
11{"run_id":"4d89ad2b-517f-40ee-a338-ac0fb94c41c3","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:54:08.052226Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});usize]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
12{"run_id":"4d89ad2b-517f-40ee-a338-ac0fb94c41c3","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:54:08.050113Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown};usize]\n[39; 40) 'y': &{unknown}\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
13{"run_id":"ef95f672-4bc0-4043-ba09-cc828ec0b621","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:56:55.243233Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': usize\n[25; 32) 'unknown': usize\n[38; 45) '[y, &y]': [usize;usize]\n[39; 40) 'y': usize\n[39; 40) 'y': usize\n[42; 44) '&y': &usize\n[43; 44) 'y': usize"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
14{"run_id":"ef95f672-4bc0-4043-ba09-cc828ec0b621","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:56:55.206265Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8;usize]\n[30; 50) '[0, b'...b'\\n']': [u8;usize]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
15{"run_id":"ef95f672-4bc0-4043-ba09-cc828ec0b621","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:56:55.243908Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});usize]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
16{"run_id":"ef95f672-4bc0-4043-ba09-cc828ec0b621","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T21:56:55.153183Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str;usize]\n[42; 45) '[x]': [&str;usize]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str;usize];usize]\n[59; 65) '[a, a]': [[&str;usize];usize]\n[60; 61) 'a': [&str;usize]\n[60; 61) 'a': [&str;usize]\n[63; 64) 'a': [&str;usize]\n[75; 76) 'c': [[[&str;usize];usize];usize]\n[79; 85) '[b, b]': [[[&str;usize];usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[83; 84) 'b': [[&str;usize];usize]\n[96; 97) 'd': [isize;usize]\n[100; 112) '[y, 1, 2, 3]': [isize;usize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize;usize]\n[126; 138) '[1, y, 2, 3]': [isize;usize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize;usize]\n[152; 155) '[y]': [isize;usize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize;usize];usize]\n[169; 175) '[d, d]': [[isize;usize];usize]\n[170; 171) 'd': [isize;usize]\n[170; 171) 'd': [isize;usize]\n[173; 174) 'd': [isize;usize]\n[185; 186) 'g': [[isize;usize];usize]\n[189; 195) '[e, e]': [[isize;usize];usize]\n[190; 191) 'e': [isize;usize]\n[190; 191) 'e': [isize;usize]\n[193; 194) 'e': [isize;usize]\n[206; 207) 'h': [i32;usize]\n[210; 216) '[1, 2]': [i32;usize]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str;usize]\n[230; 240) '[\"a\", \"b\"]': [&str;usize]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str;usize];usize]\n[255; 265) '[a, [\"b\"]]': [[&str;usize];usize]\n[256; 257) 'a': [&str;usize]\n[256; 257) 'a': [&str;usize]\n[259; 264) '[\"b\"]': [&str;usize]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8;usize]\n[288; 290) '[]': [u8;usize]\n[300; 301) 'z': &[u8;usize]\n[311; 321) '&[1, 2, 3]': &[u8;usize]\n[312; 321) '[1, 2, 3]': [u8;usize]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
17{"run_id":"60c5ca56-4eac-4d4e-ad2d-ce03a3fa5542","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:13:33.069257Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown};usize]\n[39; 40) 'y': &{unknown}\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
18{"run_id":"60c5ca56-4eac-4d4e-ad2d-ce03a3fa5542","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:13:33.030720Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8;usize]\n[30; 50) '[0, b'...b'\\n']': [u8;usize]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
19{"run_id":"60c5ca56-4eac-4d4e-ad2d-ce03a3fa5542","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:13:33.072018Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});usize]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
20{"run_id":"60c5ca56-4eac-4d4e-ad2d-ce03a3fa5542","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:13:32.980464Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str;usize]\n[42; 45) '[x]': [&str;usize]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str;usize];usize]\n[59; 65) '[a, a]': [[&str;usize];usize]\n[60; 61) 'a': [&str;usize]\n[60; 61) 'a': [&str;usize]\n[63; 64) 'a': [&str;usize]\n[75; 76) 'c': [[[&str;usize];usize];usize]\n[79; 85) '[b, b]': [[[&str;usize];usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[83; 84) 'b': [[&str;usize];usize]\n[96; 97) 'd': [isize;usize]\n[100; 112) '[y, 1, 2, 3]': [isize;usize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize;usize]\n[126; 138) '[1, y, 2, 3]': [isize;usize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize;usize]\n[152; 155) '[y]': [isize;usize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize;usize];usize]\n[169; 175) '[d, d]': [[isize;usize];usize]\n[170; 171) 'd': [isize;usize]\n[170; 171) 'd': [isize;usize]\n[173; 174) 'd': [isize;usize]\n[185; 186) 'g': [[isize;usize];usize]\n[189; 195) '[e, e]': [[isize;usize];usize]\n[190; 191) 'e': [isize;usize]\n[190; 191) 'e': [isize;usize]\n[193; 194) 'e': [isize;usize]\n[206; 207) 'h': [i32;usize]\n[210; 216) '[1, 2]': [i32;usize]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str;usize]\n[230; 240) '[\"a\", \"b\"]': [&str;usize]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str;usize];usize]\n[255; 265) '[a, [\"b\"]]': [[&str;usize];usize]\n[256; 257) 'a': [&str;usize]\n[256; 257) 'a': [&str;usize]\n[259; 264) '[\"b\"]': [&str;usize]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8;usize]\n[288; 290) '[]': [u8;usize]\n[300; 301) 'z': &[u8;usize]\n[311; 321) '&[1, 2, 3]': &[u8;usize]\n[312; 321) '[1, 2, 3]': [u8;usize]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
21{"run_id":"7b325bb3-e7ef-41e2-a9b1-392a58487127","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:15:41.060507Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8;usize]\n[30; 50) '[0, b'...b'\\n']': [u8;usize]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
22{"run_id":"7b325bb3-e7ef-41e2-a9b1-392a58487127","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:15:41.112220Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});usize]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
23{"run_id":"7b325bb3-e7ef-41e2-a9b1-392a58487127","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:15:41.110089Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown};usize]\n[39; 40) 'y': &{unknown}\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
24{"run_id":"7b325bb3-e7ef-41e2-a9b1-392a58487127","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:15:40.976255Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str;usize]\n[42; 45) '[x]': [&str;usize]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str;usize];usize]\n[59; 65) '[a, a]': [[&str;usize];usize]\n[60; 61) 'a': [&str;usize]\n[60; 61) 'a': [&str;usize]\n[63; 64) 'a': [&str;usize]\n[75; 76) 'c': [[[&str;usize];usize];usize]\n[79; 85) '[b, b]': [[[&str;usize];usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[83; 84) 'b': [[&str;usize];usize]\n[96; 97) 'd': [isize;usize]\n[100; 112) '[y, 1, 2, 3]': [isize;usize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize;usize]\n[126; 138) '[1, y, 2, 3]': [isize;usize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize;usize]\n[152; 155) '[y]': [isize;usize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize;usize];usize]\n[169; 175) '[d, d]': [[isize;usize];usize]\n[170; 171) 'd': [isize;usize]\n[170; 171) 'd': [isize;usize]\n[173; 174) 'd': [isize;usize]\n[185; 186) 'g': [[isize;usize];usize]\n[189; 195) '[e, e]': [[isize;usize];usize]\n[190; 191) 'e': [isize;usize]\n[190; 191) 'e': [isize;usize]\n[193; 194) 'e': [isize;usize]\n[206; 207) 'h': [i32;usize]\n[210; 216) '[1, 2]': [i32;usize]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str;usize]\n[230; 240) '[\"a\", \"b\"]': [&str;usize]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str;usize];usize]\n[255; 265) '[a, [\"b\"]]': [[&str;usize];usize]\n[256; 257) 'a': [&str;usize]\n[256; 257) 'a': [&str;usize]\n[259; 264) '[\"b\"]': [&str;usize]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8;usize]\n[288; 290) '[]': [u8;usize]\n[300; 301) 'z': &[u8;usize]\n[311; 321) '&[1, 2, 3]': &[u8;usize]\n[312; 321) '[1, 2, 3]': [u8;usize]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
25{"run_id":"8caa20b9-896a-42b5-848e-43f673f897e9","line":1545,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:17:29.024807Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let y = unknown;\n [y, &y];\n}\n\"#)"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown};usize]\n[39; 40) 'y': &{unknown}\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 48) '{ ...&y]; }': ()\n[21; 22) 'y': &{unknown}\n[25; 32) 'unknown': &{unknown}\n[38; 45) '[y, &y]': [&&{unknown}]\n[39; 40) 'y': &{unknown}\n[42; 44) '&y': &&{unknown}\n[43; 44) 'y': &{unknown}"}}
26{"run_id":"8caa20b9-896a-42b5-848e-43f673f897e9","line":1567,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:17:29.026807Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test() {\n let x = unknown;\n let y = unknown;\n [(x, y), (&y, &x)];\n}\n\"#)"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});usize]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[11; 80) '{ ...x)]; }': ()\n[21; 22) 'x': &&{unknown}\n[25; 32) 'unknown': &&{unknown}\n[42; 43) 'y': &&{unknown}\n[46; 53) 'unknown': &&{unknown}\n[59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown})]\n[60; 66) '(x, y)': (&&{unknown}, &&{unknown})\n[61; 62) 'x': &&{unknown}\n[64; 65) 'y': &&{unknown}\n[68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown})\n[69; 71) '&y': &&&{unknown}\n[70; 71) 'y': &&{unknown}\n[73; 75) '&x': &&&{unknown}\n[74; 75) 'x': &&{unknown}"}}
27{"run_id":"8caa20b9-896a-42b5-848e-43f673f897e9","line":1665,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:17:28.985591Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test_line_buffer() {\n &[0, b'\\n', 1, b'\\n'];\n}\n\"#)"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8;usize]\n[30; 50) '[0, b'...b'\\n']': [u8;usize]\n[31; 32) '0': u8\n[31; 32) '0': usize\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[23; 53) '{ ...n']; }': ()\n[29; 50) '&[0, b...b'\\n']': &[u8]\n[30; 50) '[0, b'...b'\\n']': [u8]\n[31; 32) '0': u8\n[34; 39) 'b'\\n'': u8\n[41; 42) '1': u8\n[44; 49) 'b'\\n'': u8"}}
28{"run_id":"8caa20b9-896a-42b5-848e-43f673f897e9","line":675,"new":{"module_name":"tests","metadata":{"created":"2019-04-03T22:17:28.933671Z","creator":"[email protected]","source":"crates/ra_hir/src/ty/tests.rs","expression":"infer(r#\"\nfn test(x: &str, y: isize) {\n let a = [x];\n let b = [a, a];\n let c = [b, b];\n\n let d = [y, 1, 2, 3];\n let d = [1, y, 2, 3];\n let e = [y];\n let f = [d, d];\n let g = [e, e];\n\n let h = [1, 2];\n let i = [\"a\", \"b\"];\n\n let b = [a, [\"b\"]];\n let x: [u8; 0] = [];\n let z: &[u8] = &[1, 2, 3];\n}\n\"#)"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str;usize]\n[42; 45) '[x]': [&str;usize]\n[43; 44) 'x': &str\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str;usize];usize]\n[59; 65) '[a, a]': [[&str;usize];usize]\n[60; 61) 'a': [&str;usize]\n[60; 61) 'a': [&str;usize]\n[63; 64) 'a': [&str;usize]\n[75; 76) 'c': [[[&str;usize];usize];usize]\n[79; 85) '[b, b]': [[[&str;usize];usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[80; 81) 'b': [[&str;usize];usize]\n[83; 84) 'b': [[&str;usize];usize]\n[96; 97) 'd': [isize;usize]\n[100; 112) '[y, 1, 2, 3]': [isize;usize]\n[101; 102) 'y': isize\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize;usize]\n[126; 138) '[1, y, 2, 3]': [isize;usize]\n[127; 128) '1': isize\n[127; 128) '1': usize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize;usize]\n[152; 155) '[y]': [isize;usize]\n[153; 154) 'y': isize\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize;usize];usize]\n[169; 175) '[d, d]': [[isize;usize];usize]\n[170; 171) 'd': [isize;usize]\n[170; 171) 'd': [isize;usize]\n[173; 174) 'd': [isize;usize]\n[185; 186) 'g': [[isize;usize];usize]\n[189; 195) '[e, e]': [[isize;usize];usize]\n[190; 191) 'e': [isize;usize]\n[190; 191) 'e': [isize;usize]\n[193; 194) 'e': [isize;usize]\n[206; 207) 'h': [i32;usize]\n[210; 216) '[1, 2]': [i32;usize]\n[211; 212) '1': i32\n[211; 212) '1': usize\n[214; 215) '2': i32\n[226; 227) 'i': [&str;usize]\n[230; 240) '[\"a\", \"b\"]': [&str;usize]\n[231; 234) '\"a\"': &str\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str;usize];usize]\n[255; 265) '[a, [\"b\"]]': [[&str;usize];usize]\n[256; 257) 'a': [&str;usize]\n[256; 257) 'a': [&str;usize]\n[259; 264) '[\"b\"]': [&str;usize]\n[260; 263) '\"b\"': &str\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8;usize]\n[288; 290) '[]': [u8;usize]\n[300; 301) 'z': &[u8;usize]\n[311; 321) '&[1, 2, 3]': &[u8;usize]\n[312; 321) '[1, 2, 3]': [u8;usize]\n[313; 314) '1': u8\n[313; 314) '1': usize\n[316; 317) '2': u8\n[319; 320) '3': u8"},"old":{"module_name":"tests","metadata":{"created":"2019-04-03T20:30:58.397743505Z"},"snapshot":"\n[9; 10) 'x': &str\n[18; 19) 'y': isize\n[28; 324) '{ ... 3]; }': ()\n[38; 39) 'a': [&str]\n[42; 45) '[x]': [&str]\n[43; 44) 'x': &str\n[55; 56) 'b': [[&str]]\n[59; 65) '[a, a]': [[&str]]\n[60; 61) 'a': [&str]\n[63; 64) 'a': [&str]\n[75; 76) 'c': [[[&str]]]\n[79; 85) '[b, b]': [[[&str]]]\n[80; 81) 'b': [[&str]]\n[83; 84) 'b': [[&str]]\n[96; 97) 'd': [isize]\n[100; 112) '[y, 1, 2, 3]': [isize]\n[101; 102) 'y': isize\n[104; 105) '1': isize\n[107; 108) '2': isize\n[110; 111) '3': isize\n[122; 123) 'd': [isize]\n[126; 138) '[1, y, 2, 3]': [isize]\n[127; 128) '1': isize\n[130; 131) 'y': isize\n[133; 134) '2': isize\n[136; 137) '3': isize\n[148; 149) 'e': [isize]\n[152; 155) '[y]': [isize]\n[153; 154) 'y': isize\n[165; 166) 'f': [[isize]]\n[169; 175) '[d, d]': [[isize]]\n[170; 171) 'd': [isize]\n[173; 174) 'd': [isize]\n[185; 186) 'g': [[isize]]\n[189; 195) '[e, e]': [[isize]]\n[190; 191) 'e': [isize]\n[193; 194) 'e': [isize]\n[206; 207) 'h': [i32]\n[210; 216) '[1, 2]': [i32]\n[211; 212) '1': i32\n[214; 215) '2': i32\n[226; 227) 'i': [&str]\n[230; 240) '[\"a\", \"b\"]': [&str]\n[231; 234) '\"a\"': &str\n[236; 239) '\"b\"': &str\n[251; 252) 'b': [[&str]]\n[255; 265) '[a, [\"b\"]]': [[&str]]\n[256; 257) 'a': [&str]\n[259; 264) '[\"b\"]': [&str]\n[260; 263) '\"b\"': &str\n[275; 276) 'x': [u8]\n[288; 290) '[]': [u8]\n[300; 301) 'z': &[u8]\n[311; 321) '&[1, 2, 3]': &[u8]\n[312; 321) '[1, 2, 3]': [u8]\n[313; 314) '1': u8\n[316; 317) '2': u8\n[319; 320) '3': u8"}}
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 887153484..d8f4ce9f8 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -1074,7 +1074,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1074 1074
1075 Ty::apply(TypeCtor::Tuple, Substs(ty_vec.into())) 1075 Ty::apply(TypeCtor::Tuple, Substs(ty_vec.into()))
1076 } 1076 }
1077 Expr::Array { exprs } => { 1077 Expr::Array { exprs, repeat } => {
1078 let elem_ty = match &expected.ty { 1078 let elem_ty = match &expected.ty {
1079 Ty::Apply(a_ty) => match a_ty.ctor { 1079 Ty::Apply(a_ty) => match a_ty.ctor {
1080 TypeCtor::Slice | TypeCtor::Array => { 1080 TypeCtor::Slice | TypeCtor::Array => {
@@ -1089,6 +1089,15 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1089 self.infer_expr(*expr, &Expectation::has_type(elem_ty.clone())); 1089 self.infer_expr(*expr, &Expectation::has_type(elem_ty.clone()));
1090 } 1090 }
1091 1091
1092 if let Some(expr) = repeat {
1093 self.infer_expr(
1094 *expr,
1095 &Expectation::has_type(Ty::simple(TypeCtor::Int(
1096 primitive::UncertainIntTy::Known(primitive::IntTy::usize()),
1097 ))),
1098 );
1099 }
1100
1092 Ty::apply_one(TypeCtor::Array, elem_ty) 1101 Ty::apply_one(TypeCtor::Array, elem_ty)
1093 } 1102 }
1094 Expr::Literal(lit) => match lit { 1103 Expr::Literal(lit) => match lit {
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 0376c91c8..39b760551 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -108,6 +108,10 @@ impl ArrayExpr {
108 pub fn exprs(&self) -> impl Iterator<Item = &Expr> { 108 pub fn exprs(&self) -> impl Iterator<Item = &Expr> {
109 super::children(self) 109 super::children(self)
110 } 110 }
111
112 pub fn repeat(&self) -> Option<&Expr> {
113 super::child_opt(self)
114 }
111} 115}
112 116
113// ArrayType 117// ArrayType
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index 0a35e25d5..c7116c69b 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -395,7 +395,8 @@ Grammar(
395 collections: [["exprs", "Expr"]] 395 collections: [["exprs", "Expr"]]
396 ), 396 ),
397 "ArrayExpr": ( 397 "ArrayExpr": (
398 collections: [["exprs", "Expr"]] 398 collections: [["exprs", "Expr"]],
399 options:[["repeat","Expr"]]
399 ), 400 ),
400 "ParenExpr": (options: ["Expr"]), 401 "ParenExpr": (options: ["Expr"]),
401 "PathExpr": (options: ["Path"]), 402 "PathExpr": (options: ["Path"]),