From d016cb486738c1ab2574a322924183fa8a870b06 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 24 Jun 2020 00:48:38 +0200 Subject: [PATCH] Use only one code-path for parsing fixtures This removes leading newlines everywhere, shifting all ranges in tests by one --- crates/ra_assists/src/tests.rs | 13 +- crates/ra_db/src/fixture.rs | 51 +- crates/ra_hir_def/src/body/scope.rs | 93 +- crates/ra_hir_ty/src/tests/coercion.rs | 632 +++---- crates/ra_hir_ty/src/tests/macros.rs | 120 +- .../ra_hir_ty/src/tests/method_resolution.rs | 378 ++-- crates/ra_hir_ty/src/tests/never_type.rs | 190 +- crates/ra_hir_ty/src/tests/patterns.rs | 570 +++--- crates/ra_hir_ty/src/tests/regression.rs | 346 ++-- crates/ra_hir_ty/src/tests/simple.rs | 1654 ++++++++--------- crates/ra_hir_ty/src/tests/traits.rs | 1494 +++++++-------- 11 files changed, 2751 insertions(+), 2790 deletions(-) diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs index 49837d60ba..858f5ca80f 100644 --- a/crates/ra_assists/src/tests.rs +++ b/crates/ra_assists/src/tests.rs @@ -4,7 +4,7 @@ use hir::Semantics; use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt}; use ra_ide_db::RootDatabase; use ra_syntax::TextRange; -use test_utils::{assert_eq_text, extract_offset, extract_range, extract_range_or_offset}; +use test_utils::{assert_eq_text, extract_offset, extract_range}; use crate::{handlers::Handler, Assist, AssistConfig, AssistContext, Assists}; use stdx::trim_indent; @@ -30,8 +30,9 @@ pub(crate) fn check_assist_not_applicable(assist: Handler, ra_fixture: &str) { } fn check_doc_test(assist_id: &str, before: &str, after: &str) { - let (selection, before) = extract_range_or_offset(before); - let (db, file_id) = crate::tests::with_single_file(&before); + let after = trim_indent(after); + let (db, file_id, selection) = RootDatabase::with_range_or_offset(&before); + let before = db.file_text(file_id).to_string(); let frange = FileRange { file_id, range: selection.into() }; let mut assist = Assist::resolved(&db, &AssistConfig::default(), frange) @@ -51,11 +52,11 @@ fn check_doc_test(assist_id: &str, before: &str, after: &str) { let actual = { let change = assist.source_change.source_file_edits.pop().unwrap(); - let mut actual = before.clone(); + let mut actual = before; change.edit.apply(&mut actual); actual }; - assert_eq_text!(after, &actual); + assert_eq_text!(&after, &actual); } enum ExpectedResult<'a> { @@ -66,7 +67,7 @@ enum ExpectedResult<'a> { fn check(handler: Handler, before: &str, expected: ExpectedResult) { let (db, file_with_caret_id, range_or_offset) = RootDatabase::with_range_or_offset(before); - let text_without_caret = db.file_text(file_with_caret_id).as_ref().to_owned(); + let text_without_caret = db.file_text(file_with_caret_id).to_string(); let frange = FileRange { file_id: file_with_caret_id, range: range_or_offset.into() }; diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 541815fe76..ddf46e6c44 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs @@ -74,8 +74,9 @@ pub const WORKSPACE: SourceRootId = SourceRootId(0); pub trait WithFixture: Default + SourceDatabaseExt + 'static { fn with_single_file(text: &str) -> (Self, FileId) { let mut db = Self::default(); - let file_id = with_single_file(&mut db, text); - (db, file_id) + let (_, files) = with_files(&mut db, text); + assert_eq!(files.len(), 1); + (db, files[0]) } fn with_files(ra_fixture: &str) -> Self { @@ -112,52 +113,6 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static { impl WithFixture for DB {} -fn with_single_file(db: &mut dyn SourceDatabaseExt, ra_fixture: &str) -> FileId { - let file_id = FileId(0); - let mut file_set = vfs::file_set::FileSet::default(); - file_set.insert(file_id, vfs::VfsPath::new_virtual_path("/main.rs".to_string())); - - let source_root = SourceRoot::new_local(file_set); - - let crate_graph = if let Some(meta) = ra_fixture.lines().find(|it| it.contains("//-")) { - let entry = Fixture::parse_meta_line(meta.trim()); - let meta = match ParsedMeta::from(&entry) { - ParsedMeta::File(it) => it, - }; - - let mut crate_graph = CrateGraph::default(); - crate_graph.add_crate_root( - file_id, - meta.edition, - meta.krate.map(|name| { - CrateName::new(&name).expect("Fixture crate name should not contain dashes") - }), - meta.cfg, - meta.env, - Default::default(), - ); - crate_graph - } else { - let mut crate_graph = CrateGraph::default(); - crate_graph.add_crate_root( - file_id, - Edition::Edition2018, - None, - CfgOptions::default(), - Env::default(), - Default::default(), - ); - crate_graph - }; - - db.set_file_text(file_id, Arc::new(ra_fixture.to_string())); - db.set_file_source_root(file_id, WORKSPACE); - db.set_source_root(WORKSPACE, Arc::new(source_root)); - db.set_crate_graph(Arc::new(crate_graph)); - - file_id -} - fn with_files( db: &mut dyn SourceDatabaseExt, fixture: &str, diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index 661f00407d..0b74199d9f 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs @@ -189,20 +189,22 @@ mod tests { } fn do_check(ra_fixture: &str, expected: &[&str]) { - let (off, code) = extract_offset(ra_fixture); + let (offset, code) = extract_offset(ra_fixture); let code = { let mut buf = String::new(); - let off: usize = off.into(); + let off: usize = offset.into(); buf.push_str(&code[..off]); - buf.push_str("marker"); + buf.push_str("<|>marker"); buf.push_str(&code[off..]); buf }; - let (db, file_id) = TestDB::with_single_file(&code); + let (db, position) = TestDB::with_position(&code); + let file_id = position.file_id; + let offset = position.offset; let file_syntax = db.parse(file_id).syntax_node(); - let marker: ast::PathExpr = find_node_at_offset(&file_syntax, off).unwrap(); + let marker: ast::PathExpr = find_node_at_offset(&file_syntax, offset).unwrap(); let function = find_function(&db, file_id); let scopes = db.expr_scopes(function.into()); @@ -302,27 +304,28 @@ mod tests { fn test_bindings_after_at() { do_check( r" - fn foo() { - match Some(()) { - opt @ Some(unit) => { - <|> - } - _ => {} - } - }", +fn foo() { + match Some(()) { + opt @ Some(unit) => { + <|> + } + _ => {} + } +} +", &["opt", "unit"], ); } - fn do_check_local_name(code: &str, expected_offset: u32) { - let (off, code) = extract_offset(code); - - let (db, file_id) = TestDB::with_single_file(&code); + fn do_check_local_name(ra_fixture: &str, expected_offset: u32) { + let (db, position) = TestDB::with_position(ra_fixture); + let file_id = position.file_id; + let offset = position.offset; let file = db.parse(file_id).ok().unwrap(); let expected_name = find_node_at_offset::(file.syntax(), expected_offset.into()) .expect("failed to find a name at the target offset"); - let name_ref: ast::NameRef = find_node_at_offset(file.syntax(), off).unwrap(); + let name_ref: ast::NameRef = find_node_at_offset(file.syntax(), offset).unwrap(); let function = find_function(&db, file_id); @@ -350,15 +353,16 @@ mod tests { fn test_resolve_local_name() { do_check_local_name( r#" - fn foo(x: i32, y: u32) { - { - let z = x * 2; - } - { - let t = x<|> * 3; - } - }"#, - 21, +fn foo(x: i32, y: u32) { + { + let z = x * 2; + } + { + let t = x<|> * 3; + } +} +"#, + 7, ); } @@ -366,10 +370,11 @@ mod tests { fn test_resolve_local_name_declaration() { do_check_local_name( r#" - fn foo(x: String) { - let x : &str = &x<|>; - }"#, - 21, +fn foo(x: String) { + let x : &str = &x<|>; +} +"#, + 7, ); } @@ -377,12 +382,12 @@ mod tests { fn test_resolve_local_name_shadow() { do_check_local_name( r" - fn foo(x: String) { - let x : &str = &x; - x<|> - } - ", - 53, +fn foo(x: String) { + let x : &str = &x; + x<|> +} +", + 28, ); } @@ -390,13 +395,13 @@ mod tests { fn ref_patterns_contribute_bindings() { do_check_local_name( r" - fn foo() { - if let Some(&from) = bar() { - from<|>; - } - } - ", - 53, +fn foo() { + if let Some(&from) = bar() { + from<|>; + } +} +", + 28, ); } diff --git a/crates/ra_hir_ty/src/tests/coercion.rs b/crates/ra_hir_ty/src/tests/coercion.rs index 6f777ed8c9..a2601c68a5 100644 --- a/crates/ra_hir_ty/src/tests/coercion.rs +++ b/crates/ra_hir_ty/src/tests/coercion.rs @@ -29,10 +29,10 @@ fn test() { } "#), @r###" - 11..41 '{ ...4 }; }': () - 21..22 'a': i32 - 30..38 '{ 1i64 }': i64 - 32..36 '1i64': i64 + 10..40 '{ ...4 }; }': () + 20..21 'a': i32 + 29..37 '{ 1i64 }': i64 + 31..35 '1i64': i64 "###); } @@ -63,50 +63,50 @@ fn test2() { } "#), @r###" - 31..32 '_': &[T] - 45..56 '{ loop {} }': T - 47..54 'loop {}': ! - 52..54 '{}': () - 65..66 '_': S<&[T]> - 82..93 '{ loop {} }': T - 84..91 'loop {}': ! - 89..91 '{}': () - 122..133 '{ loop {} }': *mut [T; _] - 124..131 'loop {}': ! - 129..131 '{}': () - 160..173 '{ gen() }': *mut [U] - 166..169 'gen': fn gen() -> *mut [U; _] - 166..171 'gen()': *mut [U; _] - 186..420 '{ ...rr); }': () - 196..199 'arr': &[u8; _] - 212..216 '&[1]': &[u8; _] - 213..216 '[1]': [u8; _] - 214..215 '1': u8 - 227..228 'a': &[u8] - 237..240 'arr': &[u8; _] - 250..251 'b': u8 - 254..255 'f': fn f(&[u8]) -> u8 - 254..260 'f(arr)': u8 - 256..259 'arr': &[u8; _] - 270..271 'c': &[u8] - 280..287 '{ arr }': &[u8] - 282..285 'arr': &[u8; _] - 297..298 'd': u8 - 301..302 'g': fn g(S<&[u8]>) -> u8 - 301..316 'g(S { a: arr })': u8 - 303..315 'S { a: arr }': S<&[u8]> - 310..313 'arr': &[u8; _] - 326..327 'e': [&[u8]; _] - 341..346 '[arr]': [&[u8]; _] - 342..345 'arr': &[u8; _] - 356..357 'f': [&[u8]; _] - 371..379 '[arr; 2]': [&[u8]; _] - 372..375 'arr': &[u8; _] - 377..378 '2': usize - 389..390 'g': (&[u8], &[u8]) - 407..417 '(arr, arr)': (&[u8], &[u8]) - 408..411 'arr': &[u8; _] - 413..416 'arr': &[u8; _] + 30..31 '_': &[T] + 44..55 '{ loop {} }': T + 46..53 'loop {}': ! + 51..53 '{}': () + 64..65 '_': S<&[T]> + 81..92 '{ loop {} }': T + 83..90 'loop {}': ! + 88..90 '{}': () + 121..132 '{ loop {} }': *mut [T; _] + 123..130 'loop {}': ! + 128..130 '{}': () + 159..172 '{ gen() }': *mut [U] + 165..168 'gen': fn gen() -> *mut [U; _] + 165..170 'gen()': *mut [U; _] + 185..419 '{ ...rr); }': () + 195..198 'arr': &[u8; _] + 211..215 '&[1]': &[u8; _] + 212..215 '[1]': [u8; _] + 213..214 '1': u8 + 226..227 'a': &[u8] + 236..239 'arr': &[u8; _] + 249..250 'b': u8 + 253..254 'f': fn f(&[u8]) -> u8 + 253..259 'f(arr)': u8 + 255..258 'arr': &[u8; _] + 269..270 'c': &[u8] + 279..286 '{ arr }': &[u8] + 281..284 'arr': &[u8; _] + 296..297 'd': u8 + 300..301 'g': fn g(S<&[u8]>) -> u8 + 300..315 'g(S { a: arr })': u8 + 302..314 'S { a: arr }': S<&[u8]> + 309..312 'arr': &[u8; _] + 325..326 'e': [&[u8]; _] + 340..345 '[arr]': [&[u8]; _] + 341..344 'arr': &[u8; _] + 355..356 'f': [&[u8]; _] + 370..378 '[arr; 2]': [&[u8]; _] + 371..374 'arr': &[u8; _] + 376..377 '2': usize + 388..389 'g': (&[u8], &[u8]) + 406..416 '(arr, arr)': (&[u8], &[u8]) + 407..410 'arr': &[u8; _] + 412..415 'arr': &[u8; _] "### ); } @@ -121,15 +121,15 @@ fn test() { } "#), @r###" - 11..76 '{ ...[1]; }': () - 21..22 'x': &[isize] - 35..39 '&[1]': &[isize; _] - 36..39 '[1]': [isize; _] - 37..38 '1': isize - 49..50 'x': *const [isize] - 69..73 '&[1]': &[isize; _] - 70..73 '[1]': [isize; _] - 71..72 '1': isize + 10..75 '{ ...[1]; }': () + 20..21 'x': &[isize] + 34..38 '&[1]': &[isize; _] + 35..38 '[1]': [isize; _] + 36..37 '1': isize + 48..49 'x': *const [isize] + 68..72 '&[1]': &[isize; _] + 69..72 '[1]': [isize; _] + 70..71 '1': isize "###); } @@ -155,31 +155,31 @@ fn test(a: A<[u8; 2]>, b: B<[u8; 2]>, c: C<[u8; 2]>) { } "#), @r###" - 258..259 'x': A<[T]> - 279..284 '{ x }': A<[T]> - 281..282 'x': A<[T]> - 296..297 'x': B<[T]> - 317..322 '{ x }': B<[T]> - 319..320 'x': B<[T]> - 334..335 'x': C<[T]> - 355..360 '{ x }': C<[T]> - 357..358 'x': C<[T]> - 370..371 'a': A<[u8; _]> - 385..386 'b': B<[u8; _]> - 400..401 'c': C<[u8; _]> - 415..481 '{ ...(c); }': () - 425..426 'd': A<[{unknown}]> - 429..433 'foo1': fn foo1<{unknown}>(A<[{unknown}]>) -> A<[{unknown}]> - 429..436 'foo1(a)': A<[{unknown}]> - 434..435 'a': A<[u8; _]> - 446..447 'e': B<[u8]> - 450..454 'foo2': fn foo2(B<[u8]>) -> B<[u8]> - 450..457 'foo2(b)': B<[u8]> - 455..456 'b': B<[u8; _]> - 467..468 'f': C<[u8]> - 471..475 'foo3': fn foo3(C<[u8]>) -> C<[u8]> - 471..478 'foo3(c)': C<[u8]> - 476..477 'c': C<[u8; _]> + 257..258 'x': A<[T]> + 278..283 '{ x }': A<[T]> + 280..281 'x': A<[T]> + 295..296 'x': B<[T]> + 316..321 '{ x }': B<[T]> + 318..319 'x': B<[T]> + 333..334 'x': C<[T]> + 354..359 '{ x }': C<[T]> + 356..357 'x': C<[T]> + 369..370 'a': A<[u8; _]> + 384..385 'b': B<[u8; _]> + 399..400 'c': C<[u8; _]> + 414..480 '{ ...(c); }': () + 424..425 'd': A<[{unknown}]> + 428..432 'foo1': fn foo1<{unknown}>(A<[{unknown}]>) -> A<[{unknown}]> + 428..435 'foo1(a)': A<[{unknown}]> + 433..434 'a': A<[u8; _]> + 445..446 'e': B<[u8]> + 449..453 'foo2': fn foo2(B<[u8]>) -> B<[u8]> + 449..456 'foo2(b)': B<[u8]> + 454..455 'b': B<[u8; _]> + 466..467 'f': C<[u8]> + 470..474 'foo3': fn foo3(C<[u8]>) -> C<[u8]> + 470..477 'foo3(c)': C<[u8]> + 475..476 'c': C<[u8; _]> "### ); } @@ -198,24 +198,24 @@ fn test() { } "#), @r###" - 11..12 'x': &[T] - 28..39 '{ loop {} }': &[T] - 30..37 'loop {}': ! - 35..37 '{}': () - 50..126 '{ ... }; }': () - 60..61 'x': &[i32] - 64..123 'if tru... }': &[i32] - 67..71 'true': bool - 72..97 '{ ... }': &[i32] - 82..85 'foo': fn foo(&[i32]) -> &[i32] - 82..91 'foo(&[1])': &[i32] - 86..90 '&[1]': &[i32; _] - 87..90 '[1]': [i32; _] - 88..89 '1': i32 - 103..123 '{ ... }': &[i32; _] - 113..117 '&[1]': &[i32; _] - 114..117 '[1]': [i32; _] - 115..116 '1': i32 + 10..11 'x': &[T] + 27..38 '{ loop {} }': &[T] + 29..36 'loop {}': ! + 34..36 '{}': () + 49..125 '{ ... }; }': () + 59..60 'x': &[i32] + 63..122 'if tru... }': &[i32] + 66..70 'true': bool + 71..96 '{ ... }': &[i32] + 81..84 'foo': fn foo(&[i32]) -> &[i32] + 81..90 'foo(&[1])': &[i32] + 85..89 '&[1]': &[i32; _] + 86..89 '[1]': [i32; _] + 87..88 '1': i32 + 102..122 '{ ... }': &[i32; _] + 112..116 '&[1]': &[i32; _] + 113..116 '[1]': [i32; _] + 114..115 '1': i32 "### ); } @@ -234,24 +234,24 @@ fn test() { } "#), @r###" - 11..12 'x': &[T] - 28..39 '{ loop {} }': &[T] - 30..37 'loop {}': ! - 35..37 '{}': () - 50..126 '{ ... }; }': () - 60..61 'x': &[i32] - 64..123 'if tru... }': &[i32] - 67..71 'true': bool - 72..92 '{ ... }': &[i32; _] - 82..86 '&[1]': &[i32; _] - 83..86 '[1]': [i32; _] - 84..85 '1': i32 - 98..123 '{ ... }': &[i32] - 108..111 'foo': fn foo(&[i32]) -> &[i32] - 108..117 'foo(&[1])': &[i32] - 112..116 '&[1]': &[i32; _] - 113..116 '[1]': [i32; _] - 114..115 '1': i32 + 10..11 'x': &[T] + 27..38 '{ loop {} }': &[T] + 29..36 'loop {}': ! + 34..36 '{}': () + 49..125 '{ ... }; }': () + 59..60 'x': &[i32] + 63..122 'if tru... }': &[i32] + 66..70 'true': bool + 71..91 '{ ... }': &[i32; _] + 81..85 '&[1]': &[i32; _] + 82..85 '[1]': [i32; _] + 83..84 '1': i32 + 97..122 '{ ... }': &[i32] + 107..110 'foo': fn foo(&[i32]) -> &[i32] + 107..116 'foo(&[1])': &[i32] + 111..115 '&[1]': &[i32; _] + 112..115 '[1]': [i32; _] + 113..114 '1': i32 "### ); } @@ -270,31 +270,31 @@ fn test(i: i32) { } "#), @r###" - 11..12 'x': &[T] - 28..39 '{ loop {} }': &[T] - 30..37 'loop {}': ! - 35..37 '{}': () - 48..49 'i': i32 - 56..150 '{ ... }; }': () - 66..67 'x': &[i32] - 70..147 'match ... }': &[i32] - 76..77 'i': i32 - 88..89 '2': i32 - 88..89 '2': i32 - 93..96 'foo': fn foo(&[i32]) -> &[i32] - 93..102 'foo(&[2])': &[i32] - 97..101 '&[2]': &[i32; _] - 98..101 '[2]': [i32; _] - 99..100 '2': i32 - 112..113 '1': i32 - 112..113 '1': i32 - 117..121 '&[1]': &[i32; _] - 118..121 '[1]': [i32; _] - 119..120 '1': i32 - 131..132 '_': i32 - 136..140 '&[3]': &[i32; _] - 137..140 '[3]': [i32; _] - 138..139 '3': i32 + 10..11 'x': &[T] + 27..38 '{ loop {} }': &[T] + 29..36 'loop {}': ! + 34..36 '{}': () + 47..48 'i': i32 + 55..149 '{ ... }; }': () + 65..66 'x': &[i32] + 69..146 'match ... }': &[i32] + 75..76 'i': i32 + 87..88 '2': i32 + 87..88 '2': i32 + 92..95 'foo': fn foo(&[i32]) -> &[i32] + 92..101 'foo(&[2])': &[i32] + 96..100 '&[2]': &[i32; _] + 97..100 '[2]': [i32; _] + 98..99 '2': i32 + 111..112 '1': i32 + 111..112 '1': i32 + 116..120 '&[1]': &[i32; _] + 117..120 '[1]': [i32; _] + 118..119 '1': i32 + 130..131 '_': i32 + 135..139 '&[3]': &[i32; _] + 136..139 '[3]': [i32; _] + 137..138 '3': i32 "### ); } @@ -313,31 +313,31 @@ fn test(i: i32) { } "#), @r###" - 11..12 'x': &[T] - 28..39 '{ loop {} }': &[T] - 30..37 'loop {}': ! - 35..37 '{}': () - 48..49 'i': i32 - 56..150 '{ ... }; }': () - 66..67 'x': &[i32] - 70..147 'match ... }': &[i32] - 76..77 'i': i32 - 88..89 '1': i32 - 88..89 '1': i32 - 93..97 '&[1]': &[i32; _] - 94..97 '[1]': [i32; _] - 95..96 '1': i32 - 107..108 '2': i32 - 107..108 '2': i32 - 112..115 'foo': fn foo(&[i32]) -> &[i32] - 112..121 'foo(&[2])': &[i32] - 116..120 '&[2]': &[i32; _] - 117..120 '[2]': [i32; _] - 118..119 '2': i32 - 131..132 '_': i32 - 136..140 '&[3]': &[i32; _] - 137..140 '[3]': [i32; _] - 138..139 '3': i32 + 10..11 'x': &[T] + 27..38 '{ loop {} }': &[T] + 29..36 'loop {}': ! + 34..36 '{}': () + 47..48 'i': i32 + 55..149 '{ ... }; }': () + 65..66 'x': &[i32] + 69..146 'match ... }': &[i32] + 75..76 'i': i32 + 87..88 '1': i32 + 87..88 '1': i32 + 92..96 '&[1]': &[i32; _] + 93..96 '[1]': [i32; _] + 94..95 '1': i32 + 106..107 '2': i32 + 106..107 '2': i32 + 111..114 'foo': fn foo(&[i32]) -> &[i32] + 111..120 'foo(&[2])': &[i32] + 115..119 '&[2]': &[i32; _] + 116..119 '[2]': [i32; _] + 117..118 '2': i32 + 130..131 '_': i32 + 135..139 '&[3]': &[i32; _] + 136..139 '[3]': [i32; _] + 137..138 '3': i32 "### ); } @@ -358,24 +358,24 @@ fn test() { } "#), @r###" - 11..145 '{ ... }; }': () - 21..22 't': &mut i32 - 25..31 '&mut 1': &mut i32 - 30..31 '1': i32 - 41..42 'x': *const i32 - 45..142 'match ... }': *const i32 - 51..52 '1': i32 - 63..64 '1': i32 - 63..64 '1': i32 - 68..69 't': &mut i32 - 68..81 't as *mut i32': *mut i32 - 91..92 '2': i32 - 91..92 '2': i32 - 96..97 't': &mut i32 - 96..105 't as &i32': &i32 - 115..116 '_': i32 - 120..121 't': &mut i32 - 120..135 't as *const i32': *const i32 + 10..144 '{ ... }; }': () + 20..21 't': &mut i32 + 24..30 '&mut 1': &mut i32 + 29..30 '1': i32 + 40..41 'x': *const i32 + 44..141 'match ... }': *const i32 + 50..51 '1': i32 + 62..63 '1': i32 + 62..63 '1': i32 + 67..68 't': &mut i32 + 67..80 't as *mut i32': *mut i32 + 90..91 '2': i32 + 90..91 '2': i32 + 95..96 't': &mut i32 + 95..104 't as &i32': &i32 + 114..115 '_': i32 + 119..120 't': &mut i32 + 119..134 't as *const i32': *const i32 "### ); } @@ -389,9 +389,9 @@ fn foo() -> u32 { } "#, true), @r###" - 17..40 '{ ...own; }': u32 - 23..37 'return unknown': ! - 30..37 'unknown': u32 + 16..39 '{ ...own; }': u32 + 22..36 'return unknown': ! + 29..36 'unknown': u32 "### ); } @@ -409,24 +409,24 @@ fn test() { } "#, true), @r###" - 30..31 'x': &Foo - 39..41 '{}': () - 52..133 '{ ...oo); }': () - 58..71 'takes_ref_foo': fn takes_ref_foo(&Foo) - 58..77 'takes_...(&Foo)': () - 72..76 '&Foo': &Foo - 73..76 'Foo': Foo - 83..96 'takes_ref_foo': fn takes_ref_foo(&Foo) - 83..103 'takes_...&&Foo)': () - 97..102 '&&Foo': &&Foo - 98..102 '&Foo': &Foo - 99..102 'Foo': Foo - 109..122 'takes_ref_foo': fn takes_ref_foo(&Foo) - 109..130 'takes_...&&Foo)': () - 123..129 '&&&Foo': &&&Foo - 124..129 '&&Foo': &&Foo - 125..129 '&Foo': &Foo - 126..129 'Foo': Foo + 29..30 'x': &Foo + 38..40 '{}': () + 51..132 '{ ...oo); }': () + 57..70 'takes_ref_foo': fn takes_ref_foo(&Foo) + 57..76 'takes_...(&Foo)': () + 71..75 '&Foo': &Foo + 72..75 'Foo': Foo + 82..95 'takes_ref_foo': fn takes_ref_foo(&Foo) + 82..102 'takes_...&&Foo)': () + 96..101 '&&Foo': &&Foo + 97..101 '&Foo': &Foo + 98..101 'Foo': Foo + 108..121 'takes_ref_foo': fn takes_ref_foo(&Foo) + 108..129 'takes_...&&Foo)': () + 122..128 '&&&Foo': &&&Foo + 123..128 '&&Foo': &&Foo + 124..128 '&Foo': &Foo + 125..128 'Foo': Foo "### ); } @@ -444,26 +444,26 @@ fn test() { } "#, true), @r###" - 29..30 'x': &T - 41..47 '{ *x }': T - 43..45 '*x': T - 44..45 'x': &T - 58..127 '{ ...oo); }': () - 64..73 'takes_ref': fn takes_ref(&Foo) -> Foo - 64..79 'takes_ref(&Foo)': Foo - 74..78 '&Foo': &Foo - 75..78 'Foo': Foo - 85..94 'takes_ref': fn takes_ref<&Foo>(&&Foo) -> &Foo - 85..101 'takes_...&&Foo)': &Foo - 95..100 '&&Foo': &&Foo - 96..100 '&Foo': &Foo - 97..100 'Foo': Foo - 107..116 'takes_ref': fn takes_ref<&&Foo>(&&&Foo) -> &&Foo - 107..124 'takes_...&&Foo)': &&Foo - 117..123 '&&&Foo': &&&Foo - 118..123 '&&Foo': &&Foo - 119..123 '&Foo': &Foo - 120..123 'Foo': Foo + 28..29 'x': &T + 40..46 '{ *x }': T + 42..44 '*x': T + 43..44 'x': &T + 57..126 '{ ...oo); }': () + 63..72 'takes_ref': fn takes_ref(&Foo) -> Foo + 63..78 'takes_ref(&Foo)': Foo + 73..77 '&Foo': &Foo + 74..77 'Foo': Foo + 84..93 'takes_ref': fn takes_ref<&Foo>(&&Foo) -> &Foo + 84..100 'takes_...&&Foo)': &Foo + 94..99 '&&Foo': &&Foo + 95..99 '&Foo': &Foo + 96..99 'Foo': Foo + 106..115 'takes_ref': fn takes_ref<&&Foo>(&&&Foo) -> &&Foo + 106..123 'takes_...&&Foo)': &&Foo + 116..122 '&&&Foo': &&&Foo + 117..122 '&&Foo': &&Foo + 118..122 '&Foo': &Foo + 119..122 'Foo': Foo "### ); } @@ -483,18 +483,18 @@ fn test() { } "#, true), @r###" - 127..128 'x': &str - 136..138 '{}': () - 169..180 '{ loop {} }': String - 171..178 'loop {}': ! - 176..178 '{}': () - 191..236 '{ ... }); }': () - 197..210 'takes_ref_str': fn takes_ref_str(&str) - 197..233 'takes_...g() })': () - 211..232 '&{ ret...ng() }': &String - 212..232 '{ retu...ng() }': String - 214..228 'returns_string': fn returns_string() -> String - 214..230 'return...ring()': String + 126..127 'x': &str + 135..137 '{}': () + 168..179 '{ loop {} }': String + 170..177 'loop {}': ! + 175..177 '{}': () + 190..235 '{ ... }); }': () + 196..209 'takes_ref_str': fn takes_ref_str(&str) + 196..232 'takes_...g() })': () + 210..231 '&{ ret...ng() }': &String + 211..231 '{ retu...ng() }': String + 213..227 'returns_string': fn returns_string() -> String + 213..229 'return...ring()': String "### ); } @@ -513,19 +513,19 @@ fn foo() { } "#, true), @r###" - 10..106 '{ ... }; }': () - 20..21 'x': || -> &u32 - 24..103 '|| { ... }': || -> &u32 - 27..103 '{ ... }': &u32 - 37..82 'if tru... }': () - 40..44 'true': bool - 45..82 '{ ... }': () - 59..71 'return &1u32': ! - 66..71 '&1u32': &u32 - 67..71 '1u32': u32 - 91..97 '&&1u32': &&u32 - 92..97 '&1u32': &u32 - 93..97 '1u32': u32 + 9..105 '{ ... }; }': () + 19..20 'x': || -> &u32 + 23..102 '|| { ... }': || -> &u32 + 26..102 '{ ... }': &u32 + 36..81 'if tru... }': () + 39..43 'true': bool + 44..81 '{ ... }': () + 58..70 'return &1u32': ! + 65..70 '&1u32': &u32 + 66..70 '1u32': u32 + 90..96 '&&1u32': &&u32 + 91..96 '&1u32': &u32 + 92..96 '1u32': u32 "### ); } @@ -540,12 +540,12 @@ fn test() { } "#, true), @r###" - 8..9 'x': u32 - 25..30 '{ 1 }': isize - 27..28 '1': isize - 41..79 '{ ...foo; }': () - 51..52 'f': fn(u32) -> isize - 73..76 'foo': fn foo(u32) -> isize + 7..8 'x': u32 + 24..29 '{ 1 }': isize + 26..27 '1': isize + 40..78 '{ ...foo; }': () + 50..51 'f': fn(u32) -> isize + 72..75 'foo': fn foo(u32) -> isize "### ); } @@ -567,27 +567,27 @@ fn test() { } "#, true), @r###" - 9..10 'x': u32 - 26..31 '{ 1 }': isize - 28..29 '1': isize - 40..41 'x': u32 - 57..62 '{ 2 }': isize - 59..60 '2': isize - 71..72 'x': u32 - 88..93 '{ 3 }': isize - 90..91 '3': isize - 104..193 '{ ... }; }': () - 114..115 'x': fn(u32) -> isize - 118..190 'match ... }': fn(u32) -> isize - 124..125 '1': i32 - 136..137 '1': i32 - 136..137 '1': i32 - 141..145 'foo1': fn foo1(u32) -> isize - 155..156 '2': i32 - 155..156 '2': i32 - 160..164 'foo2': fn foo2(u32) -> isize - 174..175 '_': i32 - 179..183 'foo3': fn foo3(u32) -> isize + 8..9 'x': u32 + 25..30 '{ 1 }': isize + 27..28 '1': isize + 39..40 'x': u32 + 56..61 '{ 2 }': isize + 58..59 '2': isize + 70..71 'x': u32 + 87..92 '{ 3 }': isize + 89..90 '3': isize + 103..192 '{ ... }; }': () + 113..114 'x': fn(u32) -> isize + 117..189 'match ... }': fn(u32) -> isize + 123..124 '1': i32 + 135..136 '1': i32 + 135..136 '1': i32 + 140..144 'foo1': fn foo1(u32) -> isize + 154..155 '2': i32 + 154..155 '2': i32 + 159..163 'foo2': fn foo2(u32) -> isize + 173..174 '_': i32 + 178..182 'foo3': fn foo3(u32) -> isize "### ); } @@ -601,12 +601,12 @@ fn test() { } "#, true), @r###" - 11..55 '{ ...1 }; }': () - 21..22 'f': fn(u32) -> isize - 43..52 '|x| { 1 }': |u32| -> isize - 44..45 'x': u32 - 47..52 '{ 1 }': isize - 49..50 '1': isize + 10..54 '{ ...1 }; }': () + 20..21 'f': fn(u32) -> isize + 42..51 '|x| { 1 }': |u32| -> isize + 43..44 'x': u32 + 46..51 '{ 1 }': isize + 48..49 '1': isize "### ); } @@ -624,11 +624,11 @@ impl S { } "#, true), @r###" - 51..55 'self': &S - 64..87 '{ ... }': &TT - 74..81 '&self.t': &TT - 75..79 'self': &S - 75..81 'self.t': TT + 50..54 'self': &S + 63..86 '{ ... }': &TT + 73..80 '&self.t': &TT + 74..78 'self': &S + 74..80 'self.t': TT "### ); } @@ -649,13 +649,13 @@ fn test() { } "#, true), @r###" - 162..199 '{ ... 3]; }': () - 172..173 'f': &[usize] - 186..196 '&[1, 2, 3]': &[usize; _] - 187..196 '[1, 2, 3]': [usize; _] - 188..189 '1': usize - 191..192 '2': usize - 194..195 '3': usize + 161..198 '{ ... 3]; }': () + 171..172 'f': &[usize] + 185..195 '&[1, 2, 3]': &[usize; _] + 186..195 '[1, 2, 3]': [usize; _] + 187..188 '1': usize + 190..191 '2': usize + 193..194 '3': usize "### ); } @@ -689,19 +689,19 @@ fn test() { } "#, true), @r###" - 388..573 '{ ...bj2; }': () - 398..401 'obj': &dyn Baz - 423..425 '&S': &S - 424..425 'S': S - 435..438 'obj': &dyn Bar - 460..463 'obj': &dyn Baz - 473..476 'obj': &dyn Foo - 495..498 'obj': &dyn Bar - 508..512 'obj2': &dyn Baz - 534..536 '&S': &S - 535..536 'S': S - 546..547 '_': &dyn Foo - 566..570 'obj2': &dyn Baz + 387..572 '{ ...bj2; }': () + 397..400 'obj': &dyn Baz + 422..424 '&S': &S + 423..424 'S': S + 434..437 'obj': &dyn Bar + 459..462 'obj': &dyn Baz + 472..475 'obj': &dyn Foo + 494..497 'obj': &dyn Bar + 507..511 'obj2': &dyn Baz + 533..535 '&S': &S + 534..535 'S': S + 545..546 '_': &dyn Foo + 565..569 'obj2': &dyn Baz "### ); } @@ -734,12 +734,12 @@ fn test() { } "#, true), @r###" - 292..348 '{ ...obj; }': () - 302..305 'obj': &dyn D - 316..318 '&S': &S - 317..318 'S': S - 328..331 'obj': &dyn A - 342..345 'obj': &dyn D + 291..347 '{ ...obj; }': () + 301..304 'obj': &dyn D + 315..317 '&S': &S + 316..317 'S': S + 327..330 'obj': &dyn A + 341..344 'obj': &dyn D "### ); } diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index 4c6099aa23..be2b48dcc0 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs @@ -71,8 +71,8 @@ fn main() { !1..4 'Foo': Foo({unknown}) -> Foo !1..16 'Foo(vec![1,2,])': Foo !5..15 'vec![1,2,]': {unknown} - 156..182 '{ ...,2); }': () - 166..167 'x': Foo + 155..181 '{ ...,2); }': () + 165..166 'x': Foo "### ); } @@ -104,10 +104,10 @@ fn main() { !1..4 'Foo': Foo({unknown}) -> Foo !1..16 'Foo(vec![1,2,])': Foo !5..15 'vec![1,2,]': {unknown} - 195..251 '{ ...,2); }': () - 205..206 'x': Foo - 228..229 'y': {unknown} - 232..248 'crate:...!(1,2)': {unknown} + 194..250 '{ ...,2); }': () + 204..205 'x': Foo + 227..228 'y': {unknown} + 231..247 'crate:...!(1,2)': {unknown} "### ); } @@ -133,9 +133,9 @@ fn main() { @r###" !0..5 '42i32': i32 !0..5 '42i32': i32 - 111..164 '{ ...!(); }': () - 121..122 'x': i32 - 148..149 'y': i32 + 110..163 '{ ...!(); }': () + 120..121 'x': i32 + 147..148 'y': i32 "### ); } @@ -197,26 +197,26 @@ fn spam() { !0..6 '1isize': isize !0..6 '1isize': isize !0..6 '1isize': isize - 54..457 '{ ...!(); }': () - 88..109 'spam!(...am!())': {unknown} - 115..134 'for _ ...!() {}': () - 119..120 '_': {unknown} - 132..134 '{}': () - 139..149 '|| spam!()': || -> isize - 155..171 'while ...!() {}': () - 169..171 '{}': () - 176..189 'break spam!()': ! - 195..209 'return spam!()': ! - 215..269 'match ... }': isize - 239..240 '_': isize - 274..290 'spam!(...am!())': {unknown} - 296..318 'Spam {...m!() }': {unknown} - 324..340 'spam!(...am!()]': {unknown} - 365..381 'spam!(... usize': usize - 387..395 '&spam!()': &isize - 401..409 '-spam!()': isize - 415..431 'spam!(...pam!()': {unknown} - 437..454 'spam!(...pam!()': isize + 53..456 '{ ...!(); }': () + 87..108 'spam!(...am!())': {unknown} + 114..133 'for _ ...!() {}': () + 118..119 '_': {unknown} + 131..133 '{}': () + 138..148 '|| spam!()': || -> isize + 154..170 'while ...!() {}': () + 168..170 '{}': () + 175..188 'break spam!()': ! + 194..208 'return spam!()': ! + 214..268 'match ... }': isize + 238..239 '_': isize + 273..289 'spam!(...am!())': {unknown} + 295..317 'Spam {...m!() }': {unknown} + 323..339 'spam!(...am!()]': {unknown} + 364..380 'spam!(... usize': usize + 386..394 '&spam!()': &isize + 400..408 '-spam!()': isize + 414..430 'spam!(...pam!()': {unknown} + 436..453 'spam!(...pam!()': isize "### ); } @@ -245,8 +245,8 @@ fn foo() { "#), @r###" !0..5 '42i32': i32 - 171..206 '{ ...32); }': () - 181..184 'foo': i32 + 170..205 '{ ...32); }': () + 180..183 'foo': i32 "### ); } @@ -397,12 +397,12 @@ fn main() { } "#), @r###" - 159..164 '{ 0 }': u64 - 161..162 '0': u64 - 175..197 '{ ...f(); }': () - 185..187 '_a': u64 - 191..192 'f': fn f() -> u64 - 191..194 'f()': u64 + 158..163 '{ 0 }': u64 + 160..161 '0': u64 + 174..196 '{ ...f(); }': () + 184..186 '_a': u64 + 190..191 'f': fn f() -> u64 + 190..193 'f()': u64 "### ); } @@ -419,10 +419,10 @@ fn main() { } "#), @r###" - !0..6 '1usize': usize - 11..90 '{ ...!(); }': () - 17..66 'macro_... }': {unknown} - 75..77 '_a': usize + !0..6 '1usize': usize + 10..89 '{ ...!(); }': () + 16..65 'macro_... }': {unknown} + 74..76 '_a': usize "### ); } @@ -466,8 +466,8 @@ fn main() { "#), @r###" !0..1 '0': i32 - 64..88 '{ ...!(); }': () - 74..75 'x': i32 + 63..87 '{ ...!(); }': () + 73..74 'x': i32 "### ); } @@ -485,8 +485,8 @@ fn main() { "#), @r###" !0..2 '""': &str - 64..88 '{ ...!(); }': () - 74..75 'x': &str + 63..87 '{ ...!(); }': () + 73..74 'x': &str "### ); } @@ -504,8 +504,8 @@ fn main() { "#), @r###" !0..1 '0': i32 - 66..92 '{ ...!(); }': () - 76..77 'x': i32 + 65..91 '{ ...!(); }': () + 75..76 'x': i32 "### ); } @@ -523,8 +523,8 @@ fn main() { "#), @r###" !0..13 '"helloworld!"': &str - 66..122 '{ ...")); }': () - 76..77 'x': &str + 65..121 '{ ...")); }': () + 75..76 'x': &str "### ); } @@ -658,8 +658,8 @@ fn main() { "#), @r###" !0..13 '"helloworld!"': &str - 104..161 '{ ...")); }': () - 114..115 'x': &str + 103..160 '{ ...")); }': () + 113..114 'x': &str "### ); } @@ -677,9 +677,9 @@ fn main() { } "#), @r###" - !0..5 '"bar"': &str - 88..116 '{ ...o"); }': () - 98..99 'x': &str + !0..22 '"__RA_...TED__"': &str + 62..90 '{ ...o"); }': () + 72..73 'x': &str "### ); } @@ -794,12 +794,12 @@ fn main() { } "#), @r###" - 52..111 '{ ... }; }': () - 62..63 'x': u32 - 66..108 'match ... }': u32 - 72..74 '()': () - 85..92 'unit!()': () - 96..101 '92u32': u32 + 51..110 '{ ... }; }': () + 61..62 'x': u32 + 65..107 'match ... }': u32 + 71..73 '()': () + 84..91 'unit!()': () + 95..100 '92u32': u32 "### ); } diff --git a/crates/ra_hir_ty/src/tests/method_resolution.rs b/crates/ra_hir_ty/src/tests/method_resolution.rs index a98efb1ccd..20329bae47 100644 --- a/crates/ra_hir_ty/src/tests/method_resolution.rs +++ b/crates/ra_hir_ty/src/tests/method_resolution.rs @@ -22,15 +22,15 @@ fn test(x: &[u8]) { } "#), @r###" - 45..49 'self': &[T] - 56..79 '{ ... }': T - 66..73 'loop {}': ! - 71..73 '{}': () - 131..132 'x': &[u8] - 141..163 '{ ...(x); }': () - 147..157 '<[_]>::foo': fn foo(&[u8]) -> u8 - 147..160 '<[_]>::foo(x)': u8 - 158..159 'x': &[u8] + 44..48 'self': &[T] + 55..78 '{ ... }': T + 65..72 'loop {}': ! + 70..72 '{}': () + 130..131 'x': &[u8] + 140..162 '{ ...(x); }': () + 146..156 '<[_]>::foo': fn foo(&[u8]) -> u8 + 146..159 '<[_]>::foo(x)': u8 + 157..158 'x': &[u8] "### ); } @@ -52,15 +52,15 @@ fn test() { } "#), @r###" - 49..75 '{ ... }': A - 59..69 'A { x: 0 }': A - 66..67 '0': u32 - 88..122 '{ ...a.x; }': () - 98..99 'a': A - 102..108 'A::new': fn new() -> A - 102..110 'A::new()': A - 116..117 'a': A - 116..119 'a.x': u32 + 48..74 '{ ... }': A + 58..68 'A { x: 0 }': A + 65..66 '0': u32 + 87..121 '{ ...a.x; }': () + 97..98 'a': A + 101..107 'A::new': fn new() -> A + 101..109 'A::new()': A + 115..116 'a': A + 115..118 'a.x': u32 "### ); } @@ -87,19 +87,19 @@ fn test() { } "#), @r###" - 47..67 '{ ... }': A - 57..61 'A::B': A - 88..108 '{ ... }': A - 98..102 'A::C': A - 121..178 '{ ... c; }': () - 131..132 'a': A - 135..139 'A::b': fn b() -> A - 135..141 'A::b()': A - 147..148 'a': A - 158..159 'c': A - 162..166 'A::c': fn c() -> A - 162..168 'A::c()': A - 174..175 'c': A + 46..66 '{ ... }': A + 56..60 'A::B': A + 87..107 '{ ... }': A + 97..101 'A::C': A + 120..177 '{ ... c; }': () + 130..131 'a': A + 134..138 'A::b': fn b() -> A + 134..140 'A::b()': A + 146..147 'a': A + 157..158 'c': A + 161..165 'A::c': fn c() -> A + 161..167 'A::c()': A + 173..174 'c': A "### ); } @@ -131,22 +131,22 @@ fn test() { } "#), @r###" - 56..64 '{ A {} }': A - 58..62 'A {}': A - 126..132 '{ 99 }': u32 - 128..130 '99': u32 - 202..210 '{ C {} }': C - 204..208 'C {}': C - 241..325 '{ ...g(); }': () - 251..252 'x': A - 255..266 'a::A::thing': fn thing() -> A - 255..268 'a::A::thing()': A - 278..279 'y': u32 - 282..293 'b::B::thing': fn thing() -> u32 - 282..295 'b::B::thing()': u32 - 305..306 'z': C - 309..320 'c::C::thing': fn thing() -> C - 309..322 'c::C::thing()': C + 55..63 '{ A {} }': A + 57..61 'A {}': A + 125..131 '{ 99 }': u32 + 127..129 '99': u32 + 201..209 '{ C {} }': C + 203..207 'C {}': C + 240..324 '{ ...g(); }': () + 250..251 'x': A + 254..265 'a::A::thing': fn thing() -> A + 254..267 'a::A::thing()': A + 277..278 'y': u32 + 281..292 'b::B::thing': fn thing() -> u32 + 281..294 'b::B::thing()': u32 + 304..305 'z': C + 308..319 'c::C::thing': fn thing() -> C + 308..321 'c::C::thing()': C "### ); } @@ -170,15 +170,15 @@ fn test() { } "#), @r###" - 64..67 'val': T - 82..109 '{ ... }': Gen - 92..103 'Gen { val }': Gen - 98..101 'val': T - 123..155 '{ ...32); }': () - 133..134 'a': Gen - 137..146 'Gen::make': fn make(u32) -> Gen - 137..152 'Gen::make(0u32)': Gen - 147..151 '0u32': u32 + 63..66 'val': T + 81..108 '{ ... }': Gen + 91..102 'Gen { val }': Gen + 97..100 'val': T + 122..154 '{ ...32); }': () + 132..133 'a': Gen + 136..145 'Gen::make': fn make(u32) -> Gen + 136..151 'Gen::make(0u32)': Gen + 146..150 '0u32': u32 "### ); } @@ -202,13 +202,13 @@ fn test() { } "#), @r###" - 76..100 '{ ... }': Gen - 86..94 'loop { }': ! - 91..94 '{ }': () - 114..149 '{ ...e(); }': () - 124..125 'a': Gen - 128..144 'Gen::<...::make': fn make() -> Gen - 128..146 'Gen::<...make()': Gen + 75..99 '{ ... }': Gen + 85..93 'loop { }': ! + 90..93 '{ }': () + 113..148 '{ ...e(); }': () + 123..124 'a': Gen + 127..143 'Gen::<...::make': fn make() -> Gen + 127..145 'Gen::<...make()': Gen "### ); } @@ -233,13 +233,13 @@ fn test() { } "#), @r###" - 102..126 '{ ... }': Gen - 112..120 'loop { }': ! - 117..120 '{ }': () - 140..180 '{ ...e(); }': () - 150..151 'a': Gen - 154..175 'Gen::<...::make': fn make() -> Gen - 154..177 'Gen::<...make()': Gen + 101..125 '{ ... }': Gen + 111..119 'loop { }': ! + 116..119 '{ }': () + 139..179 '{ ...e(); }': () + 149..150 'a': Gen + 153..174 'Gen::<...::make': fn make() -> Gen + 153..176 'Gen::<...make()': Gen "### ); } @@ -287,13 +287,13 @@ fn test() { } "#), @r###" - 31..35 'self': &Self - 110..114 'self': &Self - 170..228 '{ ...i128 }': () - 176..178 'S1': S1 - 176..187 'S1.method()': u32 - 203..205 'S2': S2 - 203..214 'S2.method()': i128 + 30..34 'self': &Self + 109..113 'self': &Self + 169..227 '{ ...i128 }': () + 175..177 'S1': S1 + 175..186 'S1.method()': u32 + 202..204 'S2': S2 + 202..213 'S2.method()': i128 "### ); } @@ -334,14 +334,14 @@ mod bar_test { } "#), @r###" - 63..67 'self': &Self - 169..173 'self': &Self - 300..337 '{ ... }': () - 310..311 'S': S - 310..320 'S.method()': u32 - 416..454 '{ ... }': () - 426..427 'S': S - 426..436 'S.method()': i128 + 62..66 'self': &Self + 168..172 'self': &Self + 299..336 '{ ... }': () + 309..310 'S': S + 309..319 'S.method()': u32 + 415..453 '{ ... }': () + 425..426 'S': S + 425..435 'S.method()': i128 "### ); } @@ -361,10 +361,10 @@ fn test() { } "#), @r###" - 33..37 'self': &Self - 92..111 '{ ...d(); }': () - 98..99 'S': S - 98..108 'S.method()': u32 + 32..36 'self': &Self + 91..110 '{ ...d(); }': () + 97..98 'S': S + 97..107 'S.method()': u32 "### ); } @@ -390,17 +390,17 @@ fn test() { } "#), @r###" - 43..47 'self': &Self - 82..86 'self': &Self - 210..361 '{ ..., i8 }': () - 216..218 'S1': S1 - 216..228 'S1.method1()': (u8, u16, u32) - 250..252 'S1': S1 - 250..262 'S1.method2()': (u32, u16, u8) - 284..286 'S2': S2 - 284..296 'S2.method1()': (i8, i16, {unknown}) - 324..326 'S2': S2 - 324..336 'S2.method2()': ({unknown}, i16, i8) + 42..46 'self': &Self + 81..85 'self': &Self + 209..360 '{ ..., i8 }': () + 215..217 'S1': S1 + 215..227 'S1.method1()': (u8, u16, u32) + 249..251 'S1': S1 + 249..261 'S1.method2()': (u32, u16, u8) + 283..285 'S2': S2 + 283..295 'S2.method1()': (i8, i16, {unknown}) + 323..325 'S2': S2 + 323..335 'S2.method2()': ({unknown}, i16, i8) "### ); } @@ -420,12 +420,12 @@ fn test() { } "#), @r###" - 33..37 'self': &Self - 102..127 '{ ...d(); }': () - 108..109 'S': S(u32) -> S - 108..115 'S(1u32)': S - 108..124 'S(1u32...thod()': u32 - 110..114 '1u32': u32 + 32..36 'self': &Self + 101..126 '{ ...d(); }': () + 107..108 'S': S(u32) -> S + 107..114 'S(1u32)': S + 107..123 'S(1u32...thod()': u32 + 109..113 '1u32': u32 "### ); } @@ -446,16 +446,16 @@ fn test() { } "#), @r###" - 87..193 '{ ...t(); }': () - 97..99 's1': S - 105..121 'Defaul...efault': fn default() -> S - 105..123 'Defaul...ault()': S - 133..135 's2': S - 138..148 'S::default': fn default() -> S - 138..150 'S::default()': S - 160..162 's3': S - 165..188 '() -> S - 165..190 '() -> S + 104..122 'Defaul...ault()': S + 132..134 's2': S + 137..147 'S::default': fn default() -> S + 137..149 'S::default()': S + 159..161 's3': S + 164..187 '() -> S + 164..189 '() -> u32 - 141..150 'S::make()': u32 - 160..161 'b': u64 - 164..178 'G::::make': fn make, u64>() -> u64 - 164..180 'G::, f64>() -> f64 - 199..208 'G::make()': f64 + 126..210 '{ ...e(); }': () + 136..137 'a': u32 + 140..147 'S::make': fn make() -> u32 + 140..149 'S::make()': u32 + 159..160 'b': u64 + 163..177 'G::::make': fn make, u64>() -> u64 + 163..179 'G::, f64>() -> f64 + 198..207 'G::make()': f64 "### ); } @@ -512,22 +512,22 @@ fn test() { } "#), @r###" - 135..313 '{ ...e(); }': () - 145..146 'a': (u32, i64) - 149..163 'S::make::': fn make() -> (u32, i64) - 149..165 'S::mak...i64>()': (u32, i64) - 175..176 'b': (u32, i64) - 189..196 'S::make': fn make() -> (u32, i64) - 189..198 'S::make()': (u32, i64) - 208..209 'c': (u32, i64) - 212..233 'G::': fn make, u32, i64>() -> (u32, i64) - 212..235 'G::()': (u32, i64) - 245..246 'd': (u32, i64) - 259..273 'G::make::': fn make, u32, i64>() -> (u32, i64) - 259..275 'G::mak...i64>()': (u32, i64) - 285..286 'e': (u32, i64) - 301..308 'G::make': fn make, u32, i64>() -> (u32, i64) - 301..310 'G::make()': (u32, i64) + 134..312 '{ ...e(); }': () + 144..145 'a': (u32, i64) + 148..162 'S::make::': fn make() -> (u32, i64) + 148..164 'S::mak...i64>()': (u32, i64) + 174..175 'b': (u32, i64) + 188..195 'S::make': fn make() -> (u32, i64) + 188..197 'S::make()': (u32, i64) + 207..208 'c': (u32, i64) + 211..232 'G::': fn make, u32, i64>() -> (u32, i64) + 211..234 'G::()': (u32, i64) + 244..245 'd': (u32, i64) + 258..272 'G::make::': fn make, u32, i64>() -> (u32, i64) + 258..274 'G::mak...i64>()': (u32, i64) + 284..285 'e': (u32, i64) + 300..307 'G::make': fn make, u32, i64>() -> (u32, i64) + 300..309 'G::make()': (u32, i64) "### ); } @@ -546,10 +546,10 @@ fn test() { } "#), @r###" - 101..127 '{ ...e(); }': () - 111..112 'a': (S, i64) - 115..122 'S::make': fn make, i64>() -> (S, i64) - 115..124 'S::make()': (S, i64) + 100..126 '{ ...e(); }': () + 110..111 'a': (S, i64) + 114..121 'S::make': fn make, i64>() -> (S, i64) + 114..123 'S::make()': (S, i64) "### ); } @@ -570,13 +570,13 @@ fn test() { } "#), @r###" - 131..203 '{ ...e(); }': () - 141..142 'a': (S, i64) - 158..165 'S::make': fn make, i64>() -> (S, i64) - 158..167 'S::make()': (S, i64) - 177..178 'b': (S, i32) - 191..198 'S::make': fn make, i32>() -> (S, i32) - 191..200 'S::make()': (S, i32) + 130..202 '{ ...e(); }': () + 140..141 'a': (S, i64) + 157..164 'S::make': fn make, i64>() -> (S, i64) + 157..166 'S::make()': (S, i64) + 176..177 'b': (S, i32) + 190..197 'S::make': fn make, i32>() -> (S, i32) + 190..199 'S::make()': (S, i32) "### ); } @@ -596,13 +596,13 @@ fn test() { } "#), @r###" - 107..211 '{ ...>(); }': () - 117..118 'a': (S, i64, u8) - 121..150 '': fn make, i64, u8>() -> (S, i64, u8) - 121..152 '()': (S, i64, u8) - 162..163 'b': (S, i64, u8) - 182..206 'Trait:...::': fn make, i64, u8>() -> (S, i64, u8) - 182..208 'Trait:...()': (S, i64, u8) + 106..210 '{ ...>(); }': () + 116..117 'a': (S, i64, u8) + 120..149 '': fn make, i64, u8>() -> (S, i64, u8) + 120..151 '()': (S, i64, u8) + 161..162 'b': (S, i64, u8) + 181..205 'Trait:...::': fn make, i64, u8>() -> (S, i64, u8) + 181..207 'Trait:...()': (S, i64, u8) "### ); } @@ -619,11 +619,11 @@ fn test(t: T) { } "#), @r###" - 30..34 'self': &Self - 64..65 't': T - 70..89 '{ ...d(); }': () - 76..77 't': T - 76..86 't.method()': u32 + 29..33 'self': &Self + 63..64 't': T + 69..88 '{ ...d(); }': () + 75..76 't': T + 75..85 't.method()': u32 "### ); } @@ -640,11 +640,11 @@ fn test>(t: T) { } "#), @r###" - 33..37 'self': &Self - 71..72 't': T - 77..96 '{ ...d(); }': () - 83..84 't': T - 83..93 't.method()': U + 32..36 'self': &Self + 70..71 't': T + 76..95 '{ ...d(); }': () + 82..83 't': T + 82..92 't.method()': U "### ); } @@ -666,18 +666,18 @@ fn test() { } "#), @r###" - 29..33 'self': Self - 111..202 '{ ...(S); }': () - 121..122 'x': u32 - 130..131 'S': S - 130..138 'S.into()': u32 - 148..149 'y': u64 - 157..158 'S': S - 157..165 'S.into()': u64 - 175..176 'z': u64 - 179..196 'Into::...::into': fn into(S) -> u64 - 179..199 'Into::...nto(S)': u64 - 197..198 'S': S + 28..32 'self': Self + 110..201 '{ ...(S); }': () + 120..121 'x': u32 + 129..130 'S': S + 129..137 'S.into()': u32 + 147..148 'y': u64 + 156..157 'S': S + 156..164 'S.into()': u64 + 174..175 'z': u64 + 178..195 'Into::...::into': fn into(S) -> u64 + 178..198 'Into::...nto(S)': u64 + 196..197 'S': S "### ); } @@ -1063,13 +1063,13 @@ fn test(d: &dyn Trait) { } "#), @r###" - 52..56 'self': &Self - 65..70 '{ 0 }': u32 - 67..68 '0': u32 - 177..178 'd': &dyn Trait - 192..208 '{ ...o(); }': () - 198..199 'd': &dyn Trait - 198..205 'd.foo()': u32 + 51..55 'self': &Self + 64..69 '{ 0 }': u32 + 66..67 '0': u32 + 176..177 'd': &dyn Trait + 191..207 '{ ...o(); }': () + 197..198 'd': &dyn Trait + 197..204 'd.foo()': u32 "### ); } diff --git a/crates/ra_hir_ty/src/tests/never_type.rs b/crates/ra_hir_ty/src/tests/never_type.rs index 082c472088..ab9a990f59 100644 --- a/crates/ra_hir_ty/src/tests/never_type.rs +++ b/crates/ra_hir_ty/src/tests/never_type.rs @@ -291,40 +291,40 @@ fn test6() { true, ); assert_snapshot!(t, @r###" - 25..53 '{ ...urn; }': () - 35..36 'x': u32 - 44..50 'return': ! - 65..98 '{ ...; }; }': () - 75..76 'x': u32 - 84..95 '{ return; }': u32 - 86..92 'return': ! - 110..139 '{ ... {}; }': () - 120..121 'x': u32 - 129..136 'loop {}': ! - 134..136 '{}': () - 151..184 '{ ...} }; }': () - 161..162 'x': u32 - 170..181 '{ loop {} }': u32 - 172..179 'loop {}': ! - 177..179 '{}': () - 196..260 '{ ...} }; }': () - 206..207 'x': u32 - 215..257 '{ if t...}; } }': u32 - 217..255 'if tru... {}; }': u32 - 220..224 'true': bool - 225..237 '{ loop {}; }': u32 - 227..234 'loop {}': ! - 232..234 '{}': () - 243..255 '{ loop {}; }': u32 - 245..252 'loop {}': ! - 250..252 '{}': () - 272..324 '{ ...; }; }': () - 282..283 'x': u32 - 291..321 '{ let ...; }; }': u32 - 297..298 'y': u32 - 306..318 '{ loop {}; }': u32 - 308..315 'loop {}': ! - 313..315 '{}': () + 11..39 '{ ...urn; }': () + 21..22 'x': u32 + 30..36 'return': ! + 51..84 '{ ...; }; }': () + 61..62 'x': u32 + 70..81 '{ return; }': u32 + 72..78 'return': ! + 96..125 '{ ... {}; }': () + 106..107 'x': u32 + 115..122 'loop {}': ! + 120..122 '{}': () + 137..170 '{ ...} }; }': () + 147..148 'x': u32 + 156..167 '{ loop {} }': u32 + 158..165 'loop {}': ! + 163..165 '{}': () + 182..246 '{ ...} }; }': () + 192..193 'x': u32 + 201..243 '{ if t...}; } }': u32 + 203..241 'if tru... {}; }': u32 + 206..210 'true': bool + 211..223 '{ loop {}; }': u32 + 213..220 'loop {}': ! + 218..220 '{}': () + 229..241 '{ loop {}; }': u32 + 231..238 'loop {}': ! + 236..238 '{}': () + 258..310 '{ ...; }; }': () + 268..269 'x': u32 + 277..307 '{ let ...; }; }': u32 + 283..284 'y': u32 + 292..304 '{ loop {}; }': u32 + 294..301 'loop {}': ! + 299..301 '{}': () "###); } @@ -341,14 +341,14 @@ fn test1() { true, ); assert_snapshot!(t, @r###" - 25..98 '{ ..." }; }': () - 68..69 'x': u32 - 77..95 '{ loop...foo" }': &str - 79..86 'loop {}': ! - 84..86 '{}': () - 88..93 '"foo"': &str - 77..95: expected u32, got &str - 88..93: expected u32, got &str + 11..84 '{ ..." }; }': () + 54..55 'x': u32 + 63..81 '{ loop...foo" }': &str + 65..72 'loop {}': ! + 70..72 '{}': () + 74..79 '"foo"': &str + 63..81: expected u32, got &str + 74..79: expected u32, got &str "###); } @@ -381,58 +381,58 @@ fn test3() { true, ); assert_snapshot!(t, @r###" - 25..99 '{ ...} }; }': () - 68..69 'x': u32 - 77..96 '{ loop...k; } }': () - 79..94 'loop { break; }': () - 84..94 '{ break; }': () - 86..91 'break': ! - 77..96: expected u32, got () - 79..94: expected u32, got () - 111..357 '{ ...; }; }': () - 154..155 'x': u32 - 163..189 '{ for ...; }; }': () - 165..186 'for a ...eak; }': () - 169..170 'a': {unknown} - 174..175 'b': {unknown} - 176..186 '{ break; }': () - 178..183 'break': ! - 240..241 'x': u32 - 249..267 '{ for ... {}; }': () - 251..264 'for a in b {}': () - 255..256 'a': {unknown} - 260..261 'b': {unknown} - 262..264 '{}': () - 318..319 'x': u32 - 327..354 '{ for ...; }; }': () - 329..351 'for a ...urn; }': () - 333..334 'a': {unknown} - 338..339 'b': {unknown} - 340..351 '{ return; }': () - 342..348 'return': ! - 163..189: expected u32, got () - 249..267: expected u32, got () - 327..354: expected u32, got () - 369..668 '{ ...; }; }': () - 412..413 'x': u32 - 421..447 '{ whil...; }; }': () - 423..444 'while ...eak; }': () - 429..433 'true': bool - 434..444 '{ break; }': () - 436..441 'break': ! - 551..552 'x': u32 - 560..578 '{ whil... {}; }': () - 562..575 'while true {}': () - 568..572 'true': bool - 573..575 '{}': () - 629..630 'x': u32 - 638..665 '{ whil...; }; }': () - 640..662 'while ...urn; }': () - 646..650 'true': bool - 651..662 '{ return; }': () - 653..659 'return': ! - 421..447: expected u32, got () - 560..578: expected u32, got () - 638..665: expected u32, got () + 11..85 '{ ...} }; }': () + 54..55 'x': u32 + 63..82 '{ loop...k; } }': () + 65..80 'loop { break; }': () + 70..80 '{ break; }': () + 72..77 'break': ! + 63..82: expected u32, got () + 65..80: expected u32, got () + 97..343 '{ ...; }; }': () + 140..141 'x': u32 + 149..175 '{ for ...; }; }': () + 151..172 'for a ...eak; }': () + 155..156 'a': {unknown} + 160..161 'b': {unknown} + 162..172 '{ break; }': () + 164..169 'break': ! + 226..227 'x': u32 + 235..253 '{ for ... {}; }': () + 237..250 'for a in b {}': () + 241..242 'a': {unknown} + 246..247 'b': {unknown} + 248..250 '{}': () + 304..305 'x': u32 + 313..340 '{ for ...; }; }': () + 315..337 'for a ...urn; }': () + 319..320 'a': {unknown} + 324..325 'b': {unknown} + 326..337 '{ return; }': () + 328..334 'return': ! + 149..175: expected u32, got () + 235..253: expected u32, got () + 313..340: expected u32, got () + 355..654 '{ ...; }; }': () + 398..399 'x': u32 + 407..433 '{ whil...; }; }': () + 409..430 'while ...eak; }': () + 415..419 'true': bool + 420..430 '{ break; }': () + 422..427 'break': ! + 537..538 'x': u32 + 546..564 '{ whil... {}; }': () + 548..561 'while true {}': () + 554..558 'true': bool + 559..561 '{}': () + 615..616 'x': u32 + 624..651 '{ whil...; }; }': () + 626..648 'while ...urn; }': () + 632..636 'true': bool + 637..648 '{ return; }': () + 639..645 'return': ! + 407..433: expected u32, got () + 546..564: expected u32, got () + 624..651: expected u32, got () "###); } diff --git a/crates/ra_hir_ty/src/tests/patterns.rs b/crates/ra_hir_ty/src/tests/patterns.rs index fe62587c0d..8fa2961377 100644 --- a/crates/ra_hir_ty/src/tests/patterns.rs +++ b/crates/ra_hir_ty/src/tests/patterns.rs @@ -30,54 +30,54 @@ fn test(x: &i32) { } "#), @r###" - 9..10 'x': &i32 - 18..369 '{ ...o_x; }': () - 28..29 'y': &i32 - 32..33 'x': &i32 - 43..45 '&z': &i32 - 44..45 'z': i32 - 48..49 'x': &i32 - 59..60 'a': i32 - 63..64 'z': i32 - 74..80 '(c, d)': (i32, &str) - 75..76 'c': i32 - 78..79 'd': &str - 83..95 '(1, "hello")': (i32, &str) - 84..85 '1': i32 - 87..94 '"hello"': &str - 102..152 'for (e... }': () - 106..112 '(e, f)': ({unknown}, {unknown}) - 107..108 'e': {unknown} - 110..111 'f': {unknown} - 116..125 'some_iter': {unknown} - 126..152 '{ ... }': () - 140..141 'g': {unknown} - 144..145 'e': {unknown} - 158..205 'if let... }': () - 165..170 '[val]': [{unknown}] - 166..169 'val': {unknown} - 173..176 'opt': [{unknown}] - 177..205 '{ ... }': () - 191..192 'h': {unknown} - 195..198 'val': {unknown} - 215..221 'lambda': |u64, u64, i32| -> i32 - 224..256 '|a: u6...b; c }': |u64, u64, i32| -> i32 - 225..226 'a': u64 - 233..234 'b': u64 - 236..237 'c': i32 - 244..256 '{ a + b; c }': i32 - 246..247 'a': u64 - 246..251 'a + b': u64 - 250..251 'b': u64 - 253..254 'c': i32 - 267..279 'ref ref_to_x': &&i32 - 282..283 'x': &i32 - 293..302 'mut mut_x': &i32 - 305..306 'x': &i32 - 316..336 'ref mu...f_to_x': &mut &i32 - 339..340 'x': &i32 - 350..351 'k': &mut &i32 - 354..366 'mut_ref_to_x': &mut &i32 + 8..9 'x': &i32 + 17..368 '{ ...o_x; }': () + 27..28 'y': &i32 + 31..32 'x': &i32 + 42..44 '&z': &i32 + 43..44 'z': i32 + 47..48 'x': &i32 + 58..59 'a': i32 + 62..63 'z': i32 + 73..79 '(c, d)': (i32, &str) + 74..75 'c': i32 + 77..78 'd': &str + 82..94 '(1, "hello")': (i32, &str) + 83..84 '1': i32 + 86..93 '"hello"': &str + 101..151 'for (e... }': () + 105..111 '(e, f)': ({unknown}, {unknown}) + 106..107 'e': {unknown} + 109..110 'f': {unknown} + 115..124 'some_iter': {unknown} + 125..151 '{ ... }': () + 139..140 'g': {unknown} + 143..144 'e': {unknown} + 157..204 'if let... }': () + 164..169 '[val]': [{unknown}] + 165..168 'val': {unknown} + 172..175 'opt': [{unknown}] + 176..204 '{ ... }': () + 190..191 'h': {unknown} + 194..197 'val': {unknown} + 214..220 'lambda': |u64, u64, i32| -> i32 + 223..255 '|a: u6...b; c }': |u64, u64, i32| -> i32 + 224..225 'a': u64 + 232..233 'b': u64 + 235..236 'c': i32 + 243..255 '{ a + b; c }': i32 + 245..246 'a': u64 + 245..250 'a + b': u64 + 249..250 'b': u64 + 252..253 'c': i32 + 266..278 'ref ref_to_x': &&i32 + 281..282 'x': &i32 + 292..301 'mut mut_x': &i32 + 304..305 'x': &i32 + 315..335 'ref mu...f_to_x': &mut &i32 + 338..339 'x': &i32 + 349..350 'k': &mut &i32 + 353..365 'mut_ref_to_x': &mut &i32 "### ); } @@ -97,47 +97,47 @@ fn test(x: &i32) { } "#, true), @r###" - 18..29 '{ loop {} }': T - 20..27 'loop {}': ! - 25..27 '{}': () - 38..39 'x': &i32 - 47..209 '{ ...) {} }': () - 53..76 'if let...y() {}': () - 60..65 '"foo"': &str - 60..65 '"foo"': &str - 68..71 'any': fn any<&str>() -> &str - 68..73 'any()': &str - 74..76 '{}': () - 81..100 'if let...y() {}': () - 88..89 '1': i32 - 88..89 '1': i32 - 92..95 'any': fn any() -> i32 - 92..97 'any()': i32 - 98..100 '{}': () - 105..127 'if let...y() {}': () - 112..116 '1u32': u32 - 112..116 '1u32': u32 - 119..122 'any': fn any() -> u32 - 119..124 'any()': u32 - 125..127 '{}': () - 132..154 'if let...y() {}': () - 139..143 '1f32': f32 - 139..143 '1f32': f32 - 146..149 'any': fn any() -> f32 - 146..151 'any()': f32 - 152..154 '{}': () - 159..180 'if let...y() {}': () - 166..169 '1.0': f64 - 166..169 '1.0': f64 - 172..175 'any': fn any() -> f64 - 172..177 'any()': f64 - 178..180 '{}': () - 185..207 'if let...y() {}': () - 192..196 'true': bool - 192..196 'true': bool - 199..202 'any': fn any() -> bool - 199..204 'any()': bool - 205..207 '{}': () + 17..28 '{ loop {} }': T + 19..26 'loop {}': ! + 24..26 '{}': () + 37..38 'x': &i32 + 46..208 '{ ...) {} }': () + 52..75 'if let...y() {}': () + 59..64 '"foo"': &str + 59..64 '"foo"': &str + 67..70 'any': fn any<&str>() -> &str + 67..72 'any()': &str + 73..75 '{}': () + 80..99 'if let...y() {}': () + 87..88 '1': i32 + 87..88 '1': i32 + 91..94 'any': fn any() -> i32 + 91..96 'any()': i32 + 97..99 '{}': () + 104..126 'if let...y() {}': () + 111..115 '1u32': u32 + 111..115 '1u32': u32 + 118..121 'any': fn any() -> u32 + 118..123 'any()': u32 + 124..126 '{}': () + 131..153 'if let...y() {}': () + 138..142 '1f32': f32 + 138..142 '1f32': f32 + 145..148 'any': fn any() -> f32 + 145..150 'any()': f32 + 151..153 '{}': () + 158..179 'if let...y() {}': () + 165..168 '1.0': f64 + 165..168 '1.0': f64 + 171..174 'any': fn any() -> f64 + 171..176 'any()': f64 + 177..179 '{}': () + 184..206 'if let...y() {}': () + 191..195 'true': bool + 191..195 'true': bool + 198..201 'any': fn any() -> bool + 198..203 'any()': bool + 204..206 '{}': () "### ); } @@ -152,16 +152,16 @@ fn test(x: &i32) { } "#, true), @r###" - 9..10 'x': &i32 - 18..76 '{ ...2 {} }': () - 24..46 'if let...u32 {}': () - 31..36 '1..76': u32 - 39..43 '2u32': u32 - 44..46 '{}': () - 51..74 'if let...u32 {}': () - 58..64 '1..=76': u32 - 67..71 '2u32': u32 - 72..74 '{}': () + 8..9 'x': &i32 + 17..75 '{ ...2 {} }': () + 23..45 'if let...u32 {}': () + 30..35 '1..76': u32 + 38..42 '2u32': u32 + 43..45 '{}': () + 50..73 'if let...u32 {}': () + 57..63 '1..=76': u32 + 66..70 '2u32': u32 + 71..73 '{}': () "### ); } @@ -178,19 +178,19 @@ fn test() { } "#), @r###" - 28..79 '{ ...(1); }': () - 38..42 'A(n)': A - 40..41 'n': &i32 - 45..50 '&A(1)': &A - 46..47 'A': A(i32) -> A - 46..50 'A(1)': A - 48..49 '1': i32 - 60..64 'A(n)': A - 62..63 'n': &mut i32 - 67..76 '&mut A(1)': &mut A - 72..73 'A': A(i32) -> A - 72..76 'A(1)': A - 74..75 '1': i32 + 27..78 '{ ...(1); }': () + 37..41 'A(n)': A + 39..40 'n': &i32 + 44..49 '&A(1)': &A + 45..46 'A': A(i32) -> A + 45..49 'A(1)': A + 47..48 '1': i32 + 59..63 'A(n)': A + 61..62 'n': &mut i32 + 66..75 '&mut A(1)': &mut A + 71..72 'A': A(i32) -> A + 71..75 'A(1)': A + 73..74 '1': i32 "### ); } @@ -206,18 +206,18 @@ fn test() { } "#), @r###" - 11..57 '{ ...= v; }': () - 21..22 'v': &(i32, &i32) - 25..33 '&(1, &2)': &(i32, &i32) - 26..33 '(1, &2)': (i32, &i32) - 27..28 '1': i32 - 30..32 '&2': &i32 - 31..32 '2': i32 - 43..50 '(_, &w)': (i32, &i32) - 44..45 '_': i32 - 47..49 '&w': &i32 - 48..49 'w': i32 - 53..54 'v': &(i32, &i32) + 10..56 '{ ...= v; }': () + 20..21 'v': &(i32, &i32) + 24..32 '&(1, &2)': &(i32, &i32) + 25..32 '(1, &2)': (i32, &i32) + 26..27 '1': i32 + 29..31 '&2': &i32 + 30..31 '2': i32 + 42..49 '(_, &w)': (i32, &i32) + 43..44 '_': i32 + 46..48 '&w': &i32 + 47..48 'w': i32 + 52..53 'v': &(i32, &i32) "### ); } @@ -242,30 +242,30 @@ fn test() { } "#), @r###" - 11..210 '{ ... } }': () - 21..26 'slice': &[f64] - 37..43 '&[0.0]': &[f64; _] - 38..43 '[0.0]': [f64; _] - 39..42 '0.0': f64 - 49..208 'match ... }': () - 55..60 'slice': &[f64] - 71..74 '&[]': &[f64] - 72..74 '[]': [f64] - 78..80 '{}': () - 90..94 '&[a]': &[f64] - 91..94 '[a]': [f64] - 92..93 'a': f64 - 98..124 '{ ... }': () - 112..113 'a': f64 - 134..141 '&[b, c]': &[f64] - 135..141 '[b, c]': [f64] - 136..137 'b': f64 - 139..140 'c': f64 - 145..186 '{ ... }': () - 159..160 'b': f64 - 174..175 'c': f64 - 195..196 '_': &[f64] - 200..202 '{}': () + 10..209 '{ ... } }': () + 20..25 'slice': &[f64] + 36..42 '&[0.0]': &[f64; _] + 37..42 '[0.0]': [f64; _] + 38..41 '0.0': f64 + 48..207 'match ... }': () + 54..59 'slice': &[f64] + 70..73 '&[]': &[f64] + 71..73 '[]': [f64] + 77..79 '{}': () + 89..93 '&[a]': &[f64] + 90..93 '[a]': [f64] + 91..92 'a': f64 + 97..123 '{ ... }': () + 111..112 'a': f64 + 133..140 '&[b, c]': &[f64] + 134..140 '[b, c]': [f64] + 135..136 'b': f64 + 138..139 'c': f64 + 144..185 '{ ... }': () + 158..159 'b': f64 + 173..174 'c': f64 + 194..195 '_': &[f64] + 199..201 '{}': () "### ); } @@ -288,25 +288,25 @@ fn test() { } "#), @r###" - 11..180 '{ ... } }': () - 21..24 'arr': [f64; _] - 37..47 '[0.0, 1.0]': [f64; _] - 38..41 '0.0': f64 - 43..46 '1.0': f64 - 53..178 'match ... }': () - 59..62 'arr': [f64; _] - 73..81 '[1.0, a]': [f64; _] - 74..77 '1.0': f64 - 74..77 '1.0': f64 - 79..80 'a': f64 - 85..111 '{ ... }': () - 99..100 'a': f64 - 121..127 '[b, c]': [f64; _] - 122..123 'b': f64 - 125..126 'c': f64 - 131..172 '{ ... }': () - 145..146 'b': f64 - 160..161 'c': f64 + 10..179 '{ ... } }': () + 20..23 'arr': [f64; _] + 36..46 '[0.0, 1.0]': [f64; _] + 37..40 '0.0': f64 + 42..45 '1.0': f64 + 52..177 'match ... }': () + 58..61 'arr': [f64; _] + 72..80 '[1.0, a]': [f64; _] + 73..76 '1.0': f64 + 73..76 '1.0': f64 + 78..79 'a': f64 + 84..110 '{ ... }': () + 98..99 'a': f64 + 120..126 '[b, c]': [f64; _] + 121..122 'b': f64 + 124..125 'c': f64 + 130..171 '{ ... }': () + 144..145 'b': f64 + 159..160 'c': f64 "### ); } @@ -339,31 +339,31 @@ fn test() { } "#), @r###" - 68..289 '{ ... d; }': () - 78..79 'e': E - 82..95 'E::A { x: 3 }': E - 92..93 '3': usize - 106..113 'S(y, z)': S - 108..109 'y': u32 - 111..112 'z': E - 116..119 'foo': S - 129..148 'E::A {..._var }': E - 139..146 'new_var': usize - 151..152 'e': E - 159..245 'match ... }': usize - 165..166 'e': E - 177..187 'E::A { x }': E - 184..185 'x': usize - 191..192 'x': usize - 202..206 'E::B': E - 210..213 'foo': bool - 217..218 '1': usize - 228..232 'E::B': E - 236..238 '10': usize - 256..275 'ref d ...{ .. }': &E - 264..275 'E::A { .. }': E - 278..279 'e': E - 285..286 'd': &E + 67..288 '{ ... d; }': () + 77..78 'e': E + 81..94 'E::A { x: 3 }': E + 91..92 '3': usize + 105..112 'S(y, z)': S + 107..108 'y': u32 + 110..111 'z': E + 115..118 'foo': S + 128..147 'E::A {..._var }': E + 138..145 'new_var': usize + 150..151 'e': E + 158..244 'match ... }': usize + 164..165 'e': E + 176..186 'E::A { x }': E + 183..184 'x': usize + 190..191 'x': usize + 201..205 'E::B': E + 209..212 'foo': bool + 216..217 '1': usize + 227..231 'E::B': E + 235..237 '10': usize + 255..274 'ref d ...{ .. }': &E + 263..274 'E::A { .. }': E + 277..278 'e': E + 284..285 'd': &E "### ); } @@ -389,20 +389,20 @@ impl E { } "#), @r###" - 76..218 '{ ... }': () - 86..211 'match ... }': () - 93..100 'loop {}': ! - 98..100 '{}': () - 116..129 'Self::A { x }': E - 126..127 'x': usize - 133..139 '{ x; }': () - 135..136 'x': usize - 153..163 'Self::B(x)': E - 161..162 'x': usize - 167..173 '{ x; }': () - 169..170 'x': usize - 187..194 'Self::C': E - 198..200 '{}': () + 75..217 '{ ... }': () + 85..210 'match ... }': () + 92..99 'loop {}': ! + 97..99 '{}': () + 115..128 'Self::A { x }': E + 125..126 'x': usize + 132..138 '{ x; }': () + 134..135 'x': usize + 152..162 'Self::B(x)': E + 160..161 'x': usize + 166..172 '{ x; }': () + 168..169 'x': usize + 186..193 'Self::C': E + 197..199 '{}': () "### ); } @@ -430,23 +430,23 @@ fn test(a1: A, o: Option) { } "#), @r###" - 79..81 'a1': A - 91..92 'o': Option - 107..244 '{ ... }; }': () - 117..128 'A { x: x2 }': A - 124..126 'x2': u32 - 131..133 'a1': A - 143..161 'A:: - 157..159 'x3': i64 - 164..174 'A { x: 1 }': A - 171..172 '1': i64 - 180..241 'match ... }': u64 - 186..187 'o': Option - 198..213 'Option::Some(t)': Option - 211..212 't': u64 - 217..218 't': u64 - 228..229 '_': Option - 233..234 '1': u64 + 78..80 'a1': A + 90..91 'o': Option + 106..243 '{ ... }; }': () + 116..127 'A { x: x2 }': A + 123..125 'x2': u32 + 130..132 'a1': A + 142..160 'A:: + 156..158 'x3': i64 + 163..173 'A { x: 1 }': A + 170..171 '1': i64 + 179..240 'match ... }': u64 + 185..186 'o': Option + 197..212 'Option::Some(t)': Option + 210..211 't': u64 + 216..217 't': u64 + 227..228 '_': Option + 232..233 '1': u64 "### ); } @@ -470,27 +470,27 @@ fn test() { } "#, true), @r###" - 74..75 '1': usize - 88..310 '{ ...atch }': () - 98..99 'a': Option - 115..119 'None': Option - 129..130 'b': Option - 146..183 'match ... }': Option - 152..153 'a': Option - 164..168 'None': Option - 172..176 'None': Option - 193..194 '_': () - 201..224 'match ... Foo }': Foo - 207..209 '()': () - 212..215 'Foo': Foo - 219..222 'Foo': Foo - 255..256 '_': () - 263..286 'match ... Bar }': usize - 269..271 '()': () - 274..277 'Bar': usize - 281..284 'Bar': usize - 201..224: expected (), got Foo - 263..286: expected (), got usize + 73..74 '1': usize + 87..309 '{ ...atch }': () + 97..98 'a': Option + 114..118 'None': Option + 128..129 'b': Option + 145..182 'match ... }': Option + 151..152 'a': Option + 163..167 'None': Option + 171..175 'None': Option + 192..193 '_': () + 200..223 'match ... Foo }': Foo + 206..208 '()': () + 211..214 'Foo': Foo + 218..221 'Foo': Foo + 254..255 '_': () + 262..285 'match ... Bar }': usize + 268..270 '()': () + 273..276 'Bar': usize + 280..283 'Bar': usize + 200..223: expected (), got Foo + 262..285: expected (), got usize "### ); } @@ -507,18 +507,18 @@ fn main() { s if s.foo() => (), } } - "#), @" - 28..32 'self': &S - 42..51 '{ false }': bool - 44..49 'false': bool - 65..116 '{ ... } }': () - 71..114 'match ... }': () - 77..78 'S': S - 89..90 's': S - 94..95 's': S - 94..101 's.foo()': bool - 105..107 '()': () - ") + "#), @r###" + 27..31 'self': &S + 41..50 '{ false }': bool + 43..48 'false': bool + 64..115 '{ ... } }': () + 70..113 'match ... }': () + 76..77 'S': S + 88..89 's': S + 93..94 's': S + 93..100 's.foo()': bool + 104..106 '()': () + "###) } #[test] @@ -538,35 +538,35 @@ fn test() { } "#), @r###" - 94..95 't': T - 100..101 'f': F - 111..122 '{ loop {} }': U - 113..120 'loop {}': ! - 118..120 '{}': () - 134..233 '{ ... x); }': () - 140..143 'foo': fn foo<&(i32, &str), i32, |&(i32, &str)| -> i32>(&(i32, &str), |&(i32, &str)| -> i32) -> i32 - 140..167 'foo(&(...y)| x)': i32 - 144..153 '&(1, "a")': &(i32, &str) - 145..153 '(1, "a")': (i32, &str) - 146..147 '1': i32 - 149..152 '"a"': &str - 155..166 '|&(x, y)| x': |&(i32, &str)| -> i32 - 156..163 '&(x, y)': &(i32, &str) - 157..163 '(x, y)': (i32, &str) - 158..159 'x': i32 - 161..162 'y': &str - 165..166 'x': i32 - 204..207 'foo': fn foo<&(i32, &str), &i32, |&(i32, &str)| -> &i32>(&(i32, &str), |&(i32, &str)| -> &i32) -> &i32 - 204..230 'foo(&(...y)| x)': &i32 - 208..217 '&(1, "a")': &(i32, &str) - 209..217 '(1, "a")': (i32, &str) - 210..211 '1': i32 - 213..216 '"a"': &str - 219..229 '|(x, y)| x': |&(i32, &str)| -> &i32 - 220..226 '(x, y)': (i32, &str) - 221..222 'x': &i32 - 224..225 'y': &&str - 228..229 'x': &i32 + 93..94 't': T + 99..100 'f': F + 110..121 '{ loop {} }': U + 112..119 'loop {}': ! + 117..119 '{}': () + 133..232 '{ ... x); }': () + 139..142 'foo': fn foo<&(i32, &str), i32, |&(i32, &str)| -> i32>(&(i32, &str), |&(i32, &str)| -> i32) -> i32 + 139..166 'foo(&(...y)| x)': i32 + 143..152 '&(1, "a")': &(i32, &str) + 144..152 '(1, "a")': (i32, &str) + 145..146 '1': i32 + 148..151 '"a"': &str + 154..165 '|&(x, y)| x': |&(i32, &str)| -> i32 + 155..162 '&(x, y)': &(i32, &str) + 156..162 '(x, y)': (i32, &str) + 157..158 'x': i32 + 160..161 'y': &str + 164..165 'x': i32 + 203..206 'foo': fn foo<&(i32, &str), &i32, |&(i32, &str)| -> &i32>(&(i32, &str), |&(i32, &str)| -> &i32) -> &i32 + 203..229 'foo(&(...y)| x)': &i32 + 207..216 '&(1, "a")': &(i32, &str) + 208..216 '(1, "a")': (i32, &str) + 209..210 '1': i32 + 212..215 '"a"': &str + 218..228 '|(x, y)| x': |&(i32, &str)| -> &i32 + 219..225 '(x, y)': (i32, &str) + 220..221 'x': &i32 + 223..224 'y': &&str + 227..228 'x': &i32 "### ); } diff --git a/crates/ra_hir_ty/src/tests/regression.rs b/crates/ra_hir_ty/src/tests/regression.rs index 4da2e972bd..eedaa27bad 100644 --- a/crates/ra_hir_ty/src/tests/regression.rs +++ b/crates/ra_hir_ty/src/tests/regression.rs @@ -15,11 +15,11 @@ fn test() { } "#), @r###" - 11..37 '{ l... {}; }': () - 20..21 'x': () - 24..34 'if true {}': () - 27..31 'true': bool - 32..34 '{}': () + 10..36 '{ l... {}; }': () + 19..20 'x': () + 23..33 'if true {}': () + 26..30 'true': bool + 31..33 '{}': () "### ); } @@ -35,10 +35,10 @@ fn test(x: X) { } "#), @r###" - 20..21 'x': X - 26..47 '{ ...eld; }': () - 32..33 'x': X - 32..44 'x.some_field': {unknown} + 19..20 'x': X + 25..46 '{ ...eld; }': () + 31..32 'x': X + 31..43 'x.some_field': {unknown} "### ); } @@ -56,14 +56,14 @@ fn test() { } "#), @r###" - 11..89 '{ ... } }': () - 17..21 'X {}': {unknown} - 27..87 'match ... }': () - 33..34 'x': {unknown} - 45..52 'A::B {}': {unknown} - 56..58 '()': () - 68..74 'A::Y()': {unknown} - 78..80 '()': () + 10..88 '{ ... } }': () + 16..20 'X {}': {unknown} + 26..86 'match ... }': () + 32..33 'x': {unknown} + 44..51 'A::B {}': {unknown} + 55..57 '()': () + 67..73 'A::Y()': {unknown} + 77..79 '()': () "### ); } @@ -78,12 +78,12 @@ fn quux() { } "#), @r###" - 11..41 '{ ...+ y; }': () - 21..22 'y': i32 - 25..27 '92': i32 - 33..34 '1': i32 - 33..38 '1 + y': i32 - 37..38 'y': i32 + 10..40 '{ ...+ y; }': () + 20..21 'y': i32 + 24..26 '92': i32 + 32..33 '1': i32 + 32..37 '1 + y': i32 + 36..37 'y': i32 "### ); } @@ -100,13 +100,13 @@ fn test() { } "#), @r###" - 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} + 10..47 '{ ...&y]; }': () + 20..21 'y': &{unknown} + 24..31 'unknown': &{unknown} + 37..44 '[y, &y]': [&&{unknown}; _] + 38..39 'y': &{unknown} + 41..43 '&y': &&{unknown} + 42..43 'y': &{unknown} "### ); } @@ -122,20 +122,20 @@ fn test() { } "#), @r###" - 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} + 10..79 '{ ...x)]; }': () + 20..21 'x': &&{unknown} + 24..31 'unknown': &&{unknown} + 41..42 'y': &&{unknown} + 45..52 'unknown': &&{unknown} + 58..76 '[(x, y..., &x)]': [(&&&{unknown}, &&&{unknown}); _] + 59..65 '(x, y)': (&&&{unknown}, &&&{unknown}) + 60..61 'x': &&{unknown} + 63..64 'y': &&{unknown} + 67..75 '(&y, &x)': (&&&{unknown}, &&&{unknown}) + 68..70 '&y': &&&{unknown} + 69..70 'y': &&{unknown} + 72..74 '&x': &&&{unknown} + 73..74 'x': &&{unknown} "### ); } @@ -157,12 +157,12 @@ fn write() { } "#), @r###" - 54..139 '{ ... } }': () - 60..137 'match ... }': () - 66..83 'someth...nknown': Maybe<{unknown}> - 94..124 'Maybe:...thing)': Maybe<{unknown}> - 106..123 'ref mu...ething': &mut {unknown} - 128..130 '()': () + 53..138 '{ ... } }': () + 59..136 'match ... }': () + 65..82 'someth...nknown': Maybe<{unknown}> + 93..123 'Maybe:...thing)': Maybe<{unknown}> + 105..122 'ref mu...ething': &mut {unknown} + 127..129 '()': () "### ); } @@ -178,13 +178,13 @@ fn test_line_buffer() { } "#), @r###" - 23..53 '{ ...n']; }': () - 29..50 '&[0, b...b'\n']': &[u8; _] - 30..50 '[0, b'...b'\n']': [u8; _] - 31..32 '0': u8 - 34..39 'b'\n'': u8 - 41..42 '1': u8 - 44..49 'b'\n'': u8 + 22..52 '{ ...n']; }': () + 28..49 '&[0, b...b'\n']': &[u8; _] + 29..49 '[0, b'...b'\n']': [u8; _] + 30..31 '0': u8 + 33..38 'b'\n'': u8 + 40..41 '1': u8 + 43..48 'b'\n'': u8 "### ); } @@ -201,14 +201,14 @@ pub fn compute() { } "#), @r###" - 18..108 '{ ... } }': () - 24..106 'match ... }': () - 30..37 'nope!()': {unknown} - 48..94 'SizeSk...tail }': {unknown} - 82..86 'true': bool - 82..86 'true': bool - 88..92 'tail': {unknown} - 98..100 '{}': () + 17..107 '{ ... } }': () + 23..105 'match ... }': () + 29..36 'nope!()': {unknown} + 47..93 'SizeSk...tail }': {unknown} + 81..85 'true': bool + 81..85 'true': bool + 87..91 'tail': {unknown} + 97..99 '{}': () "### ); } @@ -225,14 +225,14 @@ pub fn primitive_type() { } "#), @r###" - 25..106 '{ ... } }': () - 31..104 'match ... }': () - 37..42 '*self': {unknown} - 38..42 'self': {unknown} - 53..91 'Borrow...), ..}': {unknown} - 74..86 'Primitive(p)': {unknown} - 84..85 'p': {unknown} - 95..97 '{}': () + 24..105 '{ ... } }': () + 30..103 'match ... }': () + 36..41 '*self': {unknown} + 37..41 'self': {unknown} + 52..90 'Borrow...), ..}': {unknown} + 73..85 'Primitive(p)': {unknown} + 83..84 'p': {unknown} + 94..96 '{}': () "### ); } @@ -259,29 +259,29 @@ fn extra_compiler_flags() { } "#), @r###" - 27..323 '{ ... } }': () - 33..321 'for co... }': () - 37..44 'content': &{unknown} - 48..61 'doesnt_matter': {unknown} - 62..321 '{ ... }': () - 76..80 'name': &&{unknown} - 83..167 'if doe... }': &&{unknown} - 86..99 'doesnt_matter': bool - 100..129 '{ ... }': &&{unknown} - 114..119 'first': &&{unknown} - 135..167 '{ ... }': &&{unknown} - 149..157 '&content': &&{unknown} - 150..157 'content': &{unknown} - 182..189 'content': &{unknown} - 192..314 'if ICE... }': &{unknown} - 195..232 'ICE_RE..._VALUE': {unknown} - 195..248 'ICE_RE...&name)': bool - 242..247 '&name': &&&{unknown} - 243..247 'name': &&{unknown} - 249..277 '{ ... }': &&{unknown} - 263..267 'name': &&{unknown} - 283..314 '{ ... }': &{unknown} - 297..304 'content': &{unknown} + 26..322 '{ ... } }': () + 32..320 'for co... }': () + 36..43 'content': &{unknown} + 47..60 'doesnt_matter': {unknown} + 61..320 '{ ... }': () + 75..79 'name': &&{unknown} + 82..166 'if doe... }': &&{unknown} + 85..98 'doesnt_matter': bool + 99..128 '{ ... }': &&{unknown} + 113..118 'first': &&{unknown} + 134..166 '{ ... }': &&{unknown} + 148..156 '&content': &&{unknown} + 149..156 'content': &{unknown} + 181..188 'content': &{unknown} + 191..313 'if ICE... }': &{unknown} + 194..231 'ICE_RE..._VALUE': {unknown} + 194..247 'ICE_RE...&name)': bool + 241..246 '&name': &&&{unknown} + 242..246 'name': &&{unknown} + 248..276 '{ ... }': &&{unknown} + 262..266 'name': &&{unknown} + 282..313 '{ ... }': &{unknown} + 296..303 'content': &{unknown} "### ); } @@ -302,11 +302,11 @@ fn test(query_response: Canonical>) { } "#), @r###" - 92..106 'query_response': Canonical> - 137..167 '{ ...lue; }': () - 143..164 '&query....value': &QueryResponse - 144..158 'query_response': Canonical> - 144..164 'query_....value': QueryResponse + 91..105 'query_response': Canonical> + 136..166 '{ ...lue; }': () + 142..163 '&query....value': &QueryResponse + 143..157 'query_response': Canonical> + 143..163 'query_....value': QueryResponse "### ); } @@ -322,9 +322,9 @@ fn test() { "#), @r###" !0..4 '0u32': u32 - 45..70 '{ ...()); }': () - 55..56 'a': u32 - "### + 44..69 '{ ...()); }': () + 54..55 'a': u32 + "### ); } @@ -344,10 +344,10 @@ pub fn main_loop() { } "#), @r###" - 144..146 '{}': () - 169..198 '{ ...t(); }': () - 175..193 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<{unknown}, FxHasher> - 175..195 'FxHash...ault()': HashSet<{unknown}, FxHasher> + 143..145 '{}': () + 168..197 '{ ...t(); }': () + 174..192 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<{unknown}, FxHasher> + 174..194 'FxHash...ault()': HashSet<{unknown}, FxHasher> "### ); } @@ -395,9 +395,9 @@ fn test() { } "#), @r###" - 26..53 '{ ...oo() }': () - 32..49 '::foo': {unknown} - 32..51 '::foo': {unknown} + 31..50 '() -> Foo !18..28 'anything()': Foo !29..30 'r': Foo - 164..188 '{ ...!(); }': () - 174..176 '_a': Foo -"###); + 163..187 '{ ...!(); }': () + 173..175 '_a': Foo + "###); } #[test] @@ -623,13 +623,13 @@ where } "#), @r###" - 66..70 'self': Self - 268..272 'self': Self - 467..471 'self': SelectStatement - 489..523 '{ ... }': () - 499..503 'self': SelectStatement - 499..509 'self.order': O - 499..516 'self.o...into()': dyn QueryFragment + 65..69 'self': Self + 267..271 'self': Self + 466..470 'self': SelectStatement + 488..522 '{ ... }': () + 498..502 'self': SelectStatement + 498..508 'self.order': O + 498..515 'self.o...into()': dyn QueryFragment "### ); } @@ -644,10 +644,10 @@ impl Foo { } "#), @r###" - 59..73 '{ Self(0i64) }': Foo - 61..65 'Self': Foo(i64) -> Foo - 61..71 'Self(0i64)': Foo - 66..70 '0i64': i64 + 58..72 '{ Self(0i64) }': Foo + 60..64 'Self': Foo(i64) -> Foo + 60..70 'Self(0i64)': Foo + 65..69 '0i64': i64 "### ); assert_snapshot!( @@ -658,10 +658,10 @@ impl Foo { } "#), @r###" - 65..79 '{ Self(0i64) }': Foo - 67..71 'Self': Foo(i64) -> Foo - 67..77 'Self(0i64)': Foo - 72..76 '0i64': i64 + 64..78 '{ Self(0i64) }': Foo + 66..70 'Self': Foo(i64) -> Foo + 66..76 'Self(0i64)': Foo + 71..75 '0i64': i64 "### ); } @@ -685,11 +685,11 @@ fn check(i: T) { } "#), @r###" - 118..122 'self': Self - 149..150 'i': T - 155..171 '{ ...w(); }': () - 161..162 'i': T - 161..168 'i.pow()': () + 117..121 'self': Self + 148..149 'i': T + 154..170 '{ ...w(); }': () + 160..161 'i': T + 160..167 'i.pow()': () "### ); } @@ -720,13 +720,13 @@ where } "#), @r###" - 137..140 'key': &K - 199..215 '{ ...key) }': impl Future>::Bar> - 205..208 'bar': fn bar(&K) -> impl Future>::Bar> - 205..213 'bar(key)': impl Future>::Bar> - 209..212 'key': &K - 229..232 'key': &K - 291..294 '{ }': () + 136..139 'key': &K + 198..214 '{ ...key) }': impl Future>::Bar> + 204..207 'bar': fn bar(&K) -> impl Future>::Bar> + 204..212 'bar(key)': impl Future>::Bar> + 208..211 'key': &K + 228..231 'key': &K + 290..293 '{ }': () "### ); } @@ -776,11 +776,11 @@ pub trait Service { } "#), @r###" - 380..384 'self': &mut PeerSet - 402..425 '{ ... }': dyn Future - 412..419 'loop {}': ! - 417..419 '{}': () - 576..580 'self': &mut Self + 379..383 'self': &mut PeerSet + 401..424 '{ ... }': dyn Future + 411..418 'loop {}': ! + 416..418 '{}': () + 575..579 'self': &mut Self "### ); } diff --git a/crates/ra_hir_ty/src/tests/simple.rs b/crates/ra_hir_ty/src/tests/simple.rs index 37659cd02c..d7ef9add66 100644 --- a/crates/ra_hir_ty/src/tests/simple.rs +++ b/crates/ra_hir_ty/src/tests/simple.rs @@ -64,9 +64,9 @@ impl S { } "#, ), @r###" - 63..93 '{ ... }': () - 73..86 'Self { x: 1 }': S - 83..84 '1': u32 + 49..79 '{ ... }': () + 59..72 'Self { x: 1 }': S + 69..70 '1': u32 "###); } @@ -85,9 +85,9 @@ fn foo() { "#, ), @r###" - 64..84 '{ ...1 }; }': () - 70..81 'SS { x: 1 }': S - 78..79 '1': u32 + 50..70 '{ ...1 }; }': () + 56..67 'SS { x: 1 }': S + 64..65 '1': u32 "###); } @@ -175,19 +175,19 @@ fn test(a: u32, b: isize, c: !, d: &str) { 1.0f32; }"#), @r###" - 9..10 'a': u32 - 17..18 'b': isize - 27..28 'c': ! - 33..34 'd': &str - 42..121 '{ ...f32; }': () - 48..49 'a': u32 - 55..56 'b': isize - 62..63 'c': ! - 69..70 'd': &str - 76..82 '1usize': usize - 88..94 '1isize': isize - 100..106 '"test"': &str - 112..118 '1.0f32': f32 + 8..9 'a': u32 + 16..17 'b': isize + 26..27 'c': ! + 32..33 'd': &str + 41..120 '{ ...f32; }': () + 47..48 'a': u32 + 54..55 'b': isize + 61..62 'c': ! + 68..69 'd': &str + 75..81 '1usize': usize + 87..93 '1isize': isize + 99..105 '"test"': &str + 111..117 '1.0f32': f32 "### ); } @@ -206,17 +206,17 @@ fn test() { } "#), @r###" - 11..118 '{ ...= e; }': () - 21..22 'a': isize - 25..31 '1isize': isize - 41..42 'b': usize - 52..53 '1': usize - 63..64 'c': usize - 67..68 'b': usize - 78..79 'd': u32 - 94..95 'e': i32 - 105..106 'f': i32 - 114..115 'e': i32 + 10..117 '{ ...= e; }': () + 20..21 'a': isize + 24..30 '1isize': isize + 40..41 'b': usize + 51..52 '1': usize + 62..63 'c': usize + 66..67 'b': usize + 77..78 'd': u32 + 93..94 'e': i32 + 104..105 'f': i32 + 113..114 'e': i32 "### ); } @@ -237,15 +237,15 @@ fn test() { } "#), @r###" - 15..20 '{ 1 }': u32 - 17..18 '1': u32 - 48..53 '{ 1 }': u32 - 50..51 '1': u32 - 67..91 '{ ...c(); }': () - 73..74 'a': fn a() -> u32 - 73..76 'a()': u32 - 82..86 'b::c': fn c() -> u32 - 82..88 'b::c()': u32 + 14..19 '{ 1 }': u32 + 16..17 '1': u32 + 47..52 '{ 1 }': u32 + 49..50 '1': u32 + 66..90 '{ ...c(); }': () + 72..73 'a': fn a() -> u32 + 72..75 'a()': u32 + 81..85 'b::c': fn c() -> u32 + 81..87 'b::c()': u32 "### ); } @@ -266,13 +266,13 @@ fn test() { } "#), @r###" - 41..46 '{ 1 }': i32 - 43..44 '1': i32 - 60..93 '{ ...o(); }': () - 66..72 'S::foo': fn foo() -> i32 - 66..74 'S::foo()': i32 - 80..88 '::foo': fn foo() -> i32 - 80..90 '::foo()': i32 + 40..45 '{ 1 }': i32 + 42..43 '1': i32 + 59..92 '{ ...o(); }': () + 65..71 'S::foo': fn foo() -> i32 + 65..73 'S::foo()': i32 + 79..87 '::foo': fn foo() -> i32 + 79..89 '::foo()': i32 "### ); } @@ -297,22 +297,22 @@ fn test() { } "#), @r###" - 72..154 '{ ...a.c; }': () - 82..83 'c': C - 86..87 'C': C(usize) -> C - 86..90 'C(1)': C - 88..89 '1': usize - 96..97 'B': B - 107..108 'a': A - 114..133 'A { b:...C(1) }': A - 121..122 'B': B - 127..128 'C': C(usize) -> C - 127..131 'C(1)': C - 129..130 '1': usize - 139..140 'a': A - 139..142 'a.b': B - 148..149 'a': A - 148..151 'a.c': C + 71..153 '{ ...a.c; }': () + 81..82 'c': C + 85..86 'C': C(usize) -> C + 85..89 'C(1)': C + 87..88 '1': usize + 95..96 'B': B + 106..107 'a': A + 113..132 'A { b:...C(1) }': A + 120..121 'B': B + 126..127 'C': C(usize) -> C + 126..130 'C(1)': C + 128..129 '1': usize + 138..139 'a': A + 138..141 'a.b': B + 147..148 'a': A + 147..150 'a.c': C "### ); } @@ -330,10 +330,10 @@ fn test() { E::V2; }"#), @r###" - 48..82 '{ E:...:V2; }': () - 52..70 'E::V1 ...d: 1 }': E - 67..68 '1': u32 - 74..79 'E::V2': E + 47..81 '{ E:...:V2; }': () + 51..69 'E::V1 ...d: 1 }': E + 66..67 '1': u32 + 73..78 'E::V2': E "### ); } @@ -357,29 +357,29 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { } "#), @r###" - 9..10 'a': &u32 - 18..19 'b': &mut u32 - 31..32 'c': *const u32 - 46..47 'd': *mut u32 - 59..150 '{ ... *d; }': () - 65..66 'a': &u32 - 72..74 '*a': u32 - 73..74 'a': &u32 - 80..82 '&a': &&u32 - 81..82 'a': &u32 - 88..94 '&mut a': &mut &u32 - 93..94 'a': &u32 - 100..101 'b': &mut u32 - 107..109 '*b': u32 - 108..109 'b': &mut u32 - 115..117 '&b': &&mut u32 - 116..117 'b': &mut u32 - 123..124 'c': *const u32 - 130..132 '*c': u32 - 131..132 'c': *const u32 - 138..139 'd': *mut u32 - 145..147 '*d': u32 - 146..147 'd': *mut u32 + 8..9 'a': &u32 + 17..18 'b': &mut u32 + 30..31 'c': *const u32 + 45..46 'd': *mut u32 + 58..149 '{ ... *d; }': () + 64..65 'a': &u32 + 71..73 '*a': u32 + 72..73 'a': &u32 + 79..81 '&a': &&u32 + 80..81 'a': &u32 + 87..93 '&mut a': &mut &u32 + 92..93 'a': &u32 + 99..100 'b': &mut u32 + 106..108 '*b': u32 + 107..108 'b': &mut u32 + 114..116 '&b': &&mut u32 + 115..116 'b': &mut u32 + 122..123 'c': *const u32 + 129..131 '*c': u32 + 130..131 'c': *const u32 + 137..138 'd': *mut u32 + 144..146 '*d': u32 + 145..146 'd': *mut u32 "### ); } @@ -394,12 +394,12 @@ fn test(a: i32) { } "#), @r###" - 9..10 'a': i32 - 17..54 '{ ...t a; }': () - 23..33 '&raw mut a': *mut i32 - 32..33 'a': i32 - 39..51 '&raw const a': *const i32 - 50..51 'a': i32 + 8..9 'a': i32 + 16..53 '{ ...t a; }': () + 22..32 '&raw mut a': *mut i32 + 31..32 'a': i32 + 38..50 '&raw const a': *const i32 + 49..50 'a': i32 "### ); } @@ -429,20 +429,20 @@ fn test() { } "##), @r###" - 11..221 '{ ...o"#; }': () - 17..21 '5i32': i32 - 27..31 '5f32': f32 - 37..41 '5f64': f64 - 47..54 '"hello"': &str - 60..68 'b"bytes"': &[u8; _] - 74..77 ''c'': char - 83..87 'b'b'': u8 - 93..97 '3.14': f64 - 103..107 '5000': i32 - 113..118 'false': bool - 124..128 'true': bool - 134..202 'r#" ... "#': &str - 208..218 'br#"yolo"#': &[u8; _] + 10..220 '{ ...o"#; }': () + 16..20 '5i32': i32 + 26..30 '5f32': f32 + 36..40 '5f64': f64 + 46..53 '"hello"': &str + 59..67 'b"bytes"': &[u8; _] + 73..76 ''c'': char + 82..86 'b'b'': u8 + 92..96 '3.14': f64 + 102..106 '5000': i32 + 112..117 'false': bool + 123..127 'true': bool + 133..201 'r#" ... "#': &str + 207..217 'br#"yolo"#': &[u8; _] "### ); } @@ -472,47 +472,47 @@ fn test(x: SomeType) { } "#), @r###" - 27..28 'x': SomeType - 40..272 '{ ...lo"; }': () - 50..51 'b': bool - 54..59 'false': bool - 69..70 'c': bool - 73..75 '!b': bool - 74..75 'b': bool - 85..86 'a': i128 - 89..92 '100': i128 - 102..103 'd': i128 - 112..114 '-a': i128 - 113..114 'a': i128 - 124..125 'e': i32 - 128..132 '-100': i32 - 129..132 '100': i32 - 142..143 'f': bool - 146..153 '!!!true': bool - 147..153 '!!true': bool - 148..153 '!true': bool - 149..153 'true': bool - 163..164 'g': i32 - 167..170 '!42': i32 - 168..170 '42': i32 - 180..181 'h': u32 - 184..190 '!10u32': u32 - 185..190 '10u32': u32 - 200..201 'j': i128 - 204..206 '!a': i128 - 205..206 'a': i128 - 212..217 '-3.14': f64 - 213..217 '3.14': f64 - 223..225 '!3': i32 - 224..225 '3': i32 - 231..233 '-x': {unknown} - 232..233 'x': SomeType - 239..241 '!x': {unknown} - 240..241 'x': SomeType - 247..255 '-"hello"': {unknown} - 248..255 '"hello"': &str - 261..269 '!"hello"': {unknown} - 262..269 '"hello"': &str + 26..27 'x': SomeType + 39..271 '{ ...lo"; }': () + 49..50 'b': bool + 53..58 'false': bool + 68..69 'c': bool + 72..74 '!b': bool + 73..74 'b': bool + 84..85 'a': i128 + 88..91 '100': i128 + 101..102 'd': i128 + 111..113 '-a': i128 + 112..113 'a': i128 + 123..124 'e': i32 + 127..131 '-100': i32 + 128..131 '100': i32 + 141..142 'f': bool + 145..152 '!!!true': bool + 146..152 '!!true': bool + 147..152 '!true': bool + 148..152 'true': bool + 162..163 'g': i32 + 166..169 '!42': i32 + 167..169 '42': i32 + 179..180 'h': u32 + 183..189 '!10u32': u32 + 184..189 '10u32': u32 + 199..200 'j': i128 + 203..205 '!a': i128 + 204..205 'a': i128 + 211..216 '-3.14': f64 + 212..216 '3.14': f64 + 222..224 '!3': i32 + 223..224 '3': i32 + 230..232 '-x': {unknown} + 231..232 'x': SomeType + 238..240 '!x': {unknown} + 239..240 'x': SomeType + 246..254 '-"hello"': {unknown} + 247..254 '"hello"': &str + 260..268 '!"hello"': {unknown} + 261..268 '"hello"': &str "### ); } @@ -535,26 +535,26 @@ fn test() -> &mut &f64 { } "#), @r###" - 14..15 'x': u32 - 22..24 '{}': () - 78..231 '{ ...t &c }': &mut &f64 - 88..89 'a': u32 - 92..108 'unknow...nction': {unknown} - 92..110 'unknow...tion()': u32 - 116..125 'takes_u32': fn takes_u32(u32) - 116..128 'takes_u32(a)': () - 126..127 'a': u32 - 138..139 'b': i32 - 142..158 'unknow...nction': {unknown} - 142..160 'unknow...tion()': i32 - 166..184 'S { i3...d: b }': S - 181..182 'b': i32 - 194..195 'c': f64 - 198..214 'unknow...nction': {unknown} - 198..216 'unknow...tion()': f64 - 222..229 '&mut &c': &mut &f64 - 227..229 '&c': &f64 - 228..229 'c': f64 + 13..14 'x': u32 + 21..23 '{}': () + 77..230 '{ ...t &c }': &mut &f64 + 87..88 'a': u32 + 91..107 'unknow...nction': {unknown} + 91..109 'unknow...tion()': u32 + 115..124 'takes_u32': fn takes_u32(u32) + 115..127 'takes_u32(a)': () + 125..126 'a': u32 + 137..138 'b': i32 + 141..157 'unknow...nction': {unknown} + 141..159 'unknow...tion()': i32 + 165..183 'S { i3...d: b }': S + 180..181 'b': i32 + 193..194 'c': f64 + 197..213 'unknow...nction': {unknown} + 197..215 'unknow...tion()': f64 + 221..228 '&mut &c': &mut &f64 + 226..228 '&c': &f64 + 227..228 'c': f64 "### ); } @@ -581,16 +581,16 @@ impl S { } "#), @r###" - 34..38 'self': &S - 40..61 '{ ... }': () - 50..54 'self': &S - 75..79 'self': &S - 88..109 '{ ... }': () - 98..102 'self': &S - 133..153 '{ ... }': S - 143..147 'S {}': S - 177..200 '{ ... }': S - 187..194 'Self {}': S + 33..37 'self': &S + 39..60 '{ ... }': () + 49..53 'self': &S + 74..78 'self': &S + 87..108 '{ ... }': () + 97..101 'self': &S + 132..152 '{ ... }': S + 142..146 'S {}': S + 176..199 '{ ... }': S + 186..193 'Self {}': S "### ); } @@ -624,17 +624,17 @@ impl E { } "#), @r###" - 87..108 '{ ... }': () - 97..101 'Self': S1 - 135..159 '{ ... }': () - 145..149 'Self': S2(isize) -> S2 - 145..152 'Self(1)': S2 - 150..151 '1': isize - 185..231 '{ ... }': () - 195..203 'Self::V1': E - 213..221 'Self::V2': V2(u32) -> E - 213..224 'Self::V2(1)': E - 222..223 '1': u32 + 86..107 '{ ... }': () + 96..100 'Self': S1 + 134..158 '{ ... }': () + 144..148 'Self': S2(isize) -> S2 + 144..151 'Self(1)': S2 + 149..150 '1': isize + 184..230 '{ ... }': () + 194..202 'Self::V1': E + 212..220 'Self::V2': V2(u32) -> E + 212..223 'Self::V2(1)': E + 221..222 '1': u32 "### ); } @@ -664,56 +664,56 @@ fn test() -> bool { } "#), @r###" - 6..7 'x': bool - 22..34 '{ 0i32 }': i32 - 28..32 '0i32': i32 - 54..370 '{ ... < 3 }': bool - 64..65 'x': bool - 68..69 'a': bool - 68..74 'a && b': bool - 73..74 'b': bool - 84..85 'y': bool - 88..92 'true': bool - 88..101 'true || false': bool - 96..101 'false': bool - 111..112 'z': bool - 115..116 'x': bool - 115..121 'x == y': bool - 120..121 'y': bool - 131..132 't': bool - 135..136 'x': bool - 135..141 'x != y': bool - 140..141 'y': bool - 151..162 'minus_forty': isize - 172..180 '-40isize': isize - 173..180 '40isize': isize - 190..191 'h': bool - 194..205 'minus_forty': isize - 194..216 'minus_...ONST_2': bool - 209..216 'CONST_2': isize - 226..227 'c': i32 - 230..231 'f': fn f(bool) -> i32 - 230..239 'f(z || y)': i32 - 230..243 'f(z || y) + 5': i32 - 232..233 'z': bool - 232..238 'z || y': bool - 237..238 'y': bool - 242..243 '5': i32 - 253..254 'd': {unknown} - 257..258 'b': {unknown} - 268..269 'g': () - 272..283 'minus_forty': isize - 272..288 'minus_...y ^= i': () - 287..288 'i': isize - 298..301 'ten': usize - 311..313 '10': usize - 323..336 'ten_is_eleven': bool - 339..342 'ten': usize - 339..354 'ten == some_num': bool - 346..354 'some_num': usize - 361..364 'ten': usize - 361..368 'ten < 3': bool - 367..368 '3': usize + 5..6 'x': bool + 21..33 '{ 0i32 }': i32 + 27..31 '0i32': i32 + 53..369 '{ ... < 3 }': bool + 63..64 'x': bool + 67..68 'a': bool + 67..73 'a && b': bool + 72..73 'b': bool + 83..84 'y': bool + 87..91 'true': bool + 87..100 'true || false': bool + 95..100 'false': bool + 110..111 'z': bool + 114..115 'x': bool + 114..120 'x == y': bool + 119..120 'y': bool + 130..131 't': bool + 134..135 'x': bool + 134..140 'x != y': bool + 139..140 'y': bool + 150..161 'minus_forty': isize + 171..179 '-40isize': isize + 172..179 '40isize': isize + 189..190 'h': bool + 193..204 'minus_forty': isize + 193..215 'minus_...ONST_2': bool + 208..215 'CONST_2': isize + 225..226 'c': i32 + 229..230 'f': fn f(bool) -> i32 + 229..238 'f(z || y)': i32 + 229..242 'f(z || y) + 5': i32 + 231..232 'z': bool + 231..237 'z || y': bool + 236..237 'y': bool + 241..242 '5': i32 + 252..253 'd': {unknown} + 256..257 'b': {unknown} + 267..268 'g': () + 271..282 'minus_forty': isize + 271..287 'minus_...y ^= i': () + 286..287 'i': isize + 297..300 'ten': usize + 310..312 '10': usize + 322..335 'ten_is_eleven': bool + 338..341 'ten': usize + 338..353 'ten == some_num': bool + 345..353 'some_num': usize + 360..363 'ten': usize + 360..367 'ten < 3': bool + 366..367 '3': usize "### ); } @@ -728,13 +728,13 @@ fn test() { } "#), @r###" - 11..48 '{ ...5u8; }': () - 17..21 '1u32': u32 - 17..28 '1u32 << 5u8': u32 - 25..28 '5u8': u8 - 34..38 '1u32': u32 - 34..45 '1u32 >> 5u8': u32 - 42..45 '5u8': u8 + 10..47 '{ ...5u8; }': () + 16..20 '1u32': u32 + 16..27 '1u32 << 5u8': u32 + 24..27 '5u8': u8 + 33..37 '1u32': u32 + 33..44 '1u32 >> 5u8': u32 + 41..44 '5u8': u8 "### ); } @@ -767,49 +767,49 @@ fn test2(a1: *const A, a2: *mut A) { } "#), @r###" - 44..45 'a': A - 50..213 '{ ...5.b; }': () - 60..62 'a1': A - 65..66 'a': A - 72..74 'a1': A - 72..76 'a1.b': B - 86..88 'a2': &A - 91..93 '&a': &A - 92..93 'a': A - 99..101 'a2': &A - 99..103 'a2.b': B - 113..115 'a3': &mut A - 118..124 '&mut a': &mut A - 123..124 'a': A - 130..132 'a3': &mut A - 130..134 'a3.b': B - 144..146 'a4': &&&&&&&A - 149..157 '&&&&&&&a': &&&&&&&A - 150..157 '&&&&&&a': &&&&&&A - 151..157 '&&&&&a': &&&&&A - 152..157 '&&&&a': &&&&A - 153..157 '&&&a': &&&A - 154..157 '&&a': &&A - 155..157 '&a': &A - 156..157 'a': A - 163..165 'a4': &&&&&&&A - 163..167 'a4.b': B - 177..179 'a5': &mut &&mut &&mut A - 182..200 '&mut &...&mut a': &mut &&mut &&mut A - 187..200 '&&mut &&mut a': &&mut &&mut A - 188..200 '&mut &&mut a': &mut &&mut A - 193..200 '&&mut a': &&mut A - 194..200 '&mut a': &mut A - 199..200 'a': A - 206..208 'a5': &mut &&mut &&mut A - 206..210 'a5.b': B - 224..226 'a1': *const A - 238..240 'a2': *mut A - 250..273 '{ ...2.b; }': () - 256..258 'a1': *const A - 256..260 'a1.b': B - 266..268 'a2': *mut A - 266..270 'a2.b': B + 43..44 'a': A + 49..212 '{ ...5.b; }': () + 59..61 'a1': A + 64..65 'a': A + 71..73 'a1': A + 71..75 'a1.b': B + 85..87 'a2': &A + 90..92 '&a': &A + 91..92 'a': A + 98..100 'a2': &A + 98..102 'a2.b': B + 112..114 'a3': &mut A + 117..123 '&mut a': &mut A + 122..123 'a': A + 129..131 'a3': &mut A + 129..133 'a3.b': B + 143..145 'a4': &&&&&&&A + 148..156 '&&&&&&&a': &&&&&&&A + 149..156 '&&&&&&a': &&&&&&A + 150..156 '&&&&&a': &&&&&A + 151..156 '&&&&a': &&&&A + 152..156 '&&&a': &&&A + 153..156 '&&a': &&A + 154..156 '&a': &A + 155..156 'a': A + 162..164 'a4': &&&&&&&A + 162..166 'a4.b': B + 176..178 'a5': &mut &&mut &&mut A + 181..199 '&mut &...&mut a': &mut &&mut &&mut A + 186..199 '&&mut &&mut a': &&mut &&mut A + 187..199 '&mut &&mut a': &mut &&mut A + 192..199 '&&mut a': &&mut A + 193..199 '&mut a': &mut A + 198..199 'a': A + 205..207 'a5': &mut &&mut &&mut A + 205..209 'a5.b': B + 223..225 'a1': *const A + 237..239 'a2': *mut A + 249..272 '{ ...2.b; }': () + 255..257 'a1': *const A + 255..259 'a1.b': B + 265..267 'a2': *mut A + 265..269 'a2.b': B "### ); } @@ -846,30 +846,30 @@ fn test() { } "#), @r###" - 68..72 'self': &Self - 139..143 'self': &A - 151..174 '{ ... }': &T - 161..168 '&self.0': &T - 162..166 'self': &A - 162..168 'self.0': T - 255..259 'self': &B - 278..301 '{ ... }': &T - 288..295 '&self.0': &T - 289..293 'self': &B - 289..295 'self.0': T - 315..353 '{ ...))); }': () - 325..326 't': &i32 - 329..335 'A::foo': fn foo(&A) -> &i32 - 329..350 'A::foo...42))))': &i32 - 336..349 '&&B(B(A(42)))': &&B>> - 337..349 '&B(B(A(42)))': &B>> - 338..339 'B': B>>(B>) -> B>> - 338..349 'B(B(A(42)))': B>> - 340..341 'B': B>(A) -> B> - 340..348 'B(A(42))': B> - 342..343 'A': A(i32) -> A - 342..347 'A(42)': A - 344..346 '42': i32 + 67..71 'self': &Self + 138..142 'self': &A + 150..173 '{ ... }': &T + 160..167 '&self.0': &T + 161..165 'self': &A + 161..167 'self.0': T + 254..258 'self': &B + 277..300 '{ ... }': &T + 287..294 '&self.0': &T + 288..292 'self': &B + 288..294 'self.0': T + 314..352 '{ ...))); }': () + 324..325 't': &i32 + 328..334 'A::foo': fn foo(&A) -> &i32 + 328..349 'A::foo...42))))': &i32 + 335..348 '&&B(B(A(42)))': &&B>> + 336..348 '&B(B(A(42)))': &B>> + 337..338 'B': B>>(B>) -> B>> + 337..348 'B(B(A(42)))': B>> + 339..340 'B': B>(A) -> B> + 339..347 'B(A(42))': B> + 341..342 'A': A(i32) -> A + 341..346 'A(42)': A + 343..345 '42': i32 "### ); } @@ -906,34 +906,34 @@ fn test(a: A) { } "#), @r###" - 68..72 'self': &Self - 144..148 'self': &A - 150..151 'x': &A - 166..187 '{ ... }': &T - 176..181 '&*x.0': &T - 177..181 '*x.0': T - 178..179 'x': &A - 178..181 'x.0': *mut T - 268..272 'self': &B - 291..314 '{ ... }': &T - 301..308 '&self.0': &T - 302..306 'self': &B - 302..308 'self.0': T - 326..327 'a': A - 337..383 '{ ...))); }': () - 347..348 't': &i32 - 351..352 'A': A(*mut i32) -> A - 351..365 'A(0 as *mut _)': A - 351..380 'A(0 as...B(a)))': &i32 - 353..354 '0': i32 - 353..364 '0 as *mut _': *mut i32 - 370..379 '&&B(B(a))': &&B>> - 371..379 '&B(B(a))': &B>> - 372..373 'B': B>>(B>) -> B>> - 372..379 'B(B(a))': B>> - 374..375 'B': B>(A) -> B> - 374..378 'B(a)': B> - 376..377 'a': A + 67..71 'self': &Self + 143..147 'self': &A + 149..150 'x': &A + 165..186 '{ ... }': &T + 175..180 '&*x.0': &T + 176..180 '*x.0': T + 177..178 'x': &A + 177..180 'x.0': *mut T + 267..271 'self': &B + 290..313 '{ ... }': &T + 300..307 '&self.0': &T + 301..305 'self': &B + 301..307 'self.0': T + 325..326 'a': A + 336..382 '{ ...))); }': () + 346..347 't': &i32 + 350..351 'A': A(*mut i32) -> A + 350..364 'A(0 as *mut _)': A + 350..379 'A(0 as...B(a)))': &i32 + 352..353 '0': i32 + 352..363 '0 as *mut _': *mut i32 + 369..378 '&&B(B(a))': &&B>> + 370..378 '&B(B(a))': &B>> + 371..372 'B': B>>(B>) -> B>> + 371..378 'B(B(a))': B>> + 373..374 'B': B>(A) -> B> + 373..377 'B(a)': B> + 375..376 'a': A "### ); } @@ -952,16 +952,16 @@ fn main(foo: Foo) { } "#), @r###" - 35..38 'foo': Foo - 45..109 '{ ... } }': () - 51..107 'if tru... }': () - 54..58 'true': bool - 59..67 '{ }': () - 73..107 'if fal... }': i32 - 76..81 'false': bool - 82..107 '{ ... }': i32 - 92..95 'foo': Foo - 92..101 'foo.field': i32 + 34..37 'foo': Foo + 44..108 '{ ... } }': () + 50..106 'if tru... }': () + 53..57 'true': bool + 58..66 '{ }': () + 72..106 'if fal... }': i32 + 75..80 'false': bool + 81..106 '{ ... }': i32 + 91..94 'foo': Foo + 91..100 'foo.field': i32 "### ) } @@ -993,38 +993,38 @@ fn foo() { }; }"#), @r###" - 10..323 '{ ... }; }': () - 20..23 '_x1': i32 - 26..80 'if tru... }': i32 - 29..33 'true': bool - 34..51 '{ ... }': i32 - 44..45 '1': i32 - 57..80 '{ ... }': i32 - 67..73 'return': ! - 90..93 '_x2': i32 - 96..149 'if tru... }': i32 - 99..103 'true': bool - 104..121 '{ ... }': i32 - 114..115 '2': i32 - 127..149 '{ ... }': ! - 137..143 'return': ! - 159..162 '_x3': i32 - 165..247 'match ... }': i32 - 171..175 'true': bool - 186..190 'true': bool - 186..190 'true': bool - 194..195 '3': i32 - 205..206 '_': bool - 210..241 '{ ... }': i32 - 224..230 'return': ! - 257..260 '_x4': i32 - 263..320 'match ... }': i32 - 269..273 'true': bool - 284..288 'true': bool - 284..288 'true': bool - 292..293 '4': i32 - 303..304 '_': bool - 308..314 'return': ! + 9..322 '{ ... }; }': () + 19..22 '_x1': i32 + 25..79 'if tru... }': i32 + 28..32 'true': bool + 33..50 '{ ... }': i32 + 43..44 '1': i32 + 56..79 '{ ... }': i32 + 66..72 'return': ! + 89..92 '_x2': i32 + 95..148 'if tru... }': i32 + 98..102 'true': bool + 103..120 '{ ... }': i32 + 113..114 '2': i32 + 126..148 '{ ... }': ! + 136..142 'return': ! + 158..161 '_x3': i32 + 164..246 'match ... }': i32 + 170..174 'true': bool + 185..189 'true': bool + 185..189 'true': bool + 193..194 '3': i32 + 204..205 '_': bool + 209..240 '{ ... }': i32 + 223..229 'return': ! + 256..259 '_x4': i32 + 262..319 'match ... }': i32 + 268..272 'true': bool + 283..287 'true': bool + 283..287 'true': bool + 291..292 '4': i32 + 302..303 '_': bool + 307..313 'return': ! "### ) } @@ -1052,24 +1052,24 @@ fn test(a: A) { } "#), @r###" - 32..36 'self': A - 38..39 'x': u32 - 53..55 '{}': () - 103..107 'self': &A - 109..110 'x': u64 - 124..126 '{}': () - 144..145 'a': A - 150..198 '{ ...(1); }': () - 156..157 'a': A - 156..164 'a.foo(1)': i32 - 162..163 '1': u32 - 170..181 '(&a).bar(1)': i64 - 171..173 '&a': &A - 172..173 'a': A - 179..180 '1': u64 - 187..188 'a': A - 187..195 'a.bar(1)': i64 - 193..194 '1': u64 + 31..35 'self': A + 37..38 'x': u32 + 52..54 '{}': () + 102..106 'self': &A + 108..109 'x': u64 + 123..125 '{}': () + 143..144 'a': A + 149..197 '{ ...(1); }': () + 155..156 'a': A + 155..163 'a.foo(1)': i32 + 161..162 '1': u32 + 169..180 '(&a).bar(1)': i64 + 170..172 '&a': &A + 171..172 'a': A + 178..179 '1': u64 + 186..187 'a': A + 186..194 'a.bar(1)': i64 + 192..193 '1': u64 "### ); } @@ -1088,11 +1088,11 @@ fn test() { } "#), @r###" - 40..44 'self': &str - 53..55 '{}': () - 69..89 '{ ...o(); }': () - 75..80 '"foo"': &str - 75..86 '"foo".foo()': i32 + 39..43 'self': &str + 52..54 '{}': () + 68..88 '{ ...o(); }': () + 74..79 '"foo"': &str + 74..85 '"foo".foo()': i32 "### ); } @@ -1111,33 +1111,33 @@ fn test(x: &str, y: isize) { } "#), @r###" - 9..10 'x': &str - 18..19 'y': isize - 28..170 '{ ...d"); }': () - 38..39 'a': (u32, &str) - 55..63 '(1, "a")': (u32, &str) - 56..57 '1': u32 - 59..62 '"a"': &str - 73..74 'b': ((u32, &str), &str) - 77..83 '(a, x)': ((u32, &str), &str) - 78..79 'a': (u32, &str) - 81..82 'x': &str - 93..94 'c': (isize, &str) - 97..103 '(y, x)': (isize, &str) - 98..99 'y': isize - 101..102 'x': &str - 113..114 'd': ((isize, &str), &str) - 117..123 '(c, x)': ((isize, &str), &str) - 118..119 'c': (isize, &str) - 121..122 'x': &str - 133..134 'e': (i32, &str) - 137..145 '(1, "e")': (i32, &str) - 138..139 '1': i32 - 141..144 '"e"': &str - 155..156 'f': ((i32, &str), &str) - 159..167 '(e, "d")': ((i32, &str), &str) - 160..161 'e': (i32, &str) - 163..166 '"d"': &str + 8..9 'x': &str + 17..18 'y': isize + 27..169 '{ ...d"); }': () + 37..38 'a': (u32, &str) + 54..62 '(1, "a")': (u32, &str) + 55..56 '1': u32 + 58..61 '"a"': &str + 72..73 'b': ((u32, &str), &str) + 76..82 '(a, x)': ((u32, &str), &str) + 77..78 'a': (u32, &str) + 80..81 'x': &str + 92..93 'c': (isize, &str) + 96..102 '(y, x)': (isize, &str) + 97..98 'y': isize + 100..101 'x': &str + 112..113 'd': ((isize, &str), &str) + 116..122 '(c, x)': ((isize, &str), &str) + 117..118 'c': (isize, &str) + 120..121 'x': &str + 132..133 'e': (i32, &str) + 136..144 '(1, "e")': (i32, &str) + 137..138 '1': i32 + 140..143 '"e"': &str + 154..155 'f': ((i32, &str), &str) + 158..166 '(e, "d")': ((i32, &str), &str) + 159..160 'e': (i32, &str) + 162..165 '"d"': &str "### ); } @@ -1165,58 +1165,58 @@ fn test(x: &str, y: isize) { } "#), @r###" - 9..10 'x': &str - 18..19 'y': isize - 28..293 '{ ... []; }': () - 38..39 'a': [&str; _] - 42..45 '[x]': [&str; _] - 43..44 'x': &str - 55..56 'b': [[&str; _]; _] - 59..65 '[a, a]': [[&str; _]; _] - 60..61 'a': [&str; _] - 63..64 'a': [&str; _] - 75..76 'c': [[[&str; _]; _]; _] - 79..85 '[b, b]': [[[&str; _]; _]; _] - 80..81 'b': [[&str; _]; _] - 83..84 'b': [[&str; _]; _] - 96..97 'd': [isize; _] - 100..112 '[y, 1, 2, 3]': [isize; _] - 101..102 'y': isize - 104..105 '1': isize - 107..108 '2': isize - 110..111 '3': isize - 122..123 'd': [isize; _] - 126..138 '[1, y, 2, 3]': [isize; _] - 127..128 '1': isize - 130..131 'y': isize - 133..134 '2': isize - 136..137 '3': isize - 148..149 'e': [isize; _] - 152..155 '[y]': [isize; _] - 153..154 'y': isize - 165..166 'f': [[isize; _]; _] - 169..175 '[d, d]': [[isize; _]; _] - 170..171 'd': [isize; _] - 173..174 'd': [isize; _] - 185..186 'g': [[isize; _]; _] - 189..195 '[e, e]': [[isize; _]; _] - 190..191 'e': [isize; _] - 193..194 'e': [isize; _] - 206..207 'h': [i32; _] - 210..216 '[1, 2]': [i32; _] - 211..212 '1': i32 - 214..215 '2': i32 - 226..227 'i': [&str; _] - 230..240 '["a", "b"]': [&str; _] - 231..234 '"a"': &str - 236..239 '"b"': &str - 251..252 'b': [[&str; _]; _] - 255..265 '[a, ["b"]]': [[&str; _]; _] - 256..257 'a': [&str; _] - 259..264 '["b"]': [&str; _] - 260..263 '"b"': &str - 275..276 'x': [u8; _] - 288..290 '[]': [u8; _] + 8..9 'x': &str + 17..18 'y': isize + 27..292 '{ ... []; }': () + 37..38 'a': [&str; _] + 41..44 '[x]': [&str; _] + 42..43 'x': &str + 54..55 'b': [[&str; _]; _] + 58..64 '[a, a]': [[&str; _]; _] + 59..60 'a': [&str; _] + 62..63 'a': [&str; _] + 74..75 'c': [[[&str; _]; _]; _] + 78..84 '[b, b]': [[[&str; _]; _]; _] + 79..80 'b': [[&str; _]; _] + 82..83 'b': [[&str; _]; _] + 95..96 'd': [isize; _] + 99..111 '[y, 1, 2, 3]': [isize; _] + 100..101 'y': isize + 103..104 '1': isize + 106..107 '2': isize + 109..110 '3': isize + 121..122 'd': [isize; _] + 125..137 '[1, y, 2, 3]': [isize; _] + 126..127 '1': isize + 129..130 'y': isize + 132..133 '2': isize + 135..136 '3': isize + 147..148 'e': [isize; _] + 151..154 '[y]': [isize; _] + 152..153 'y': isize + 164..165 'f': [[isize; _]; _] + 168..174 '[d, d]': [[isize; _]; _] + 169..170 'd': [isize; _] + 172..173 'd': [isize; _] + 184..185 'g': [[isize; _]; _] + 188..194 '[e, e]': [[isize; _]; _] + 189..190 'e': [isize; _] + 192..193 'e': [isize; _] + 205..206 'h': [i32; _] + 209..215 '[1, 2]': [i32; _] + 210..211 '1': i32 + 213..214 '2': i32 + 225..226 'i': [&str; _] + 229..239 '["a", "b"]': [&str; _] + 230..233 '"a"': &str + 235..238 '"b"': &str + 250..251 'b': [[&str; _]; _] + 254..264 '[a, ["b"]]': [[&str; _]; _] + 255..256 'a': [&str; _] + 258..263 '["b"]': [&str; _] + 259..262 '"b"': &str + 274..275 'x': [u8; _] + 287..289 '[]': [u8; _] "### ); } @@ -1238,21 +1238,21 @@ fn test(a1: A, i: i32) { } "#), @r###" - 36..38 'a1': A - 48..49 'i': i32 - 56..147 '{ ...3.x; }': () - 62..64 'a1': A - 62..66 'a1.x': u32 - 76..78 'a2': A - 81..91 'A { x: i }': A - 88..89 'i': i32 - 97..99 'a2': A - 97..101 'a2.x': i32 - 111..113 'a3': A - 116..134 'A:: - 131..132 '1': i128 - 140..142 'a3': A - 140..144 'a3.x': i128 + 35..37 'a1': A + 47..48 'i': i32 + 55..146 '{ ...3.x; }': () + 61..63 'a1': A + 61..65 'a1.x': u32 + 75..77 'a2': A + 80..90 'A { x: i }': A + 87..88 'i': i32 + 96..98 'a2': A + 96..100 'a2.x': i32 + 110..112 'a3': A + 115..133 'A:: + 130..131 '1': i128 + 139..141 'a3': A + 139..143 'a3.x': i128 "### ); } @@ -1275,22 +1275,22 @@ fn test() { } "#), @r###" - 76..184 '{ ...one; }': () - 82..83 'A': A(i32) -> A - 82..87 'A(42)': A - 84..86 '42': i32 - 93..94 'A': A(u128) -> A - 93..102 'A(42u128)': A - 95..101 '42u128': u128 - 108..112 'Some': Some<&str>(&str) -> Option<&str> - 108..117 'Some("x")': Option<&str> - 113..116 '"x"': &str - 123..135 'Option::Some': Some<&str>(&str) -> Option<&str> - 123..140 'Option...e("x")': Option<&str> - 136..139 '"x"': &str - 146..150 'None': Option<{unknown}> - 160..161 'x': Option - 177..181 'None': Option + 75..183 '{ ...one; }': () + 81..82 'A': A(i32) -> A + 81..86 'A(42)': A + 83..85 '42': i32 + 92..93 'A': A(u128) -> A + 92..101 'A(42u128)': A + 94..100 '42u128': u128 + 107..111 'Some': Some<&str>(&str) -> Option<&str> + 107..116 'Some("x")': Option<&str> + 112..115 '"x"': &str + 122..134 'Option::Some': Some<&str>(&str) -> Option<&str> + 122..139 'Option...e("x")': Option<&str> + 135..138 '"x"': &str + 145..149 'None': Option<{unknown}> + 159..160 'x': Option + 176..180 'None': Option "### ); } @@ -1308,20 +1308,20 @@ fn test() { } "#), @r###" - 10..11 't': T - 21..26 '{ t }': T - 23..24 't': T - 38..98 '{ ...(1); }': () - 44..46 'id': fn id(u32) -> u32 - 44..52 'id(1u32)': u32 - 47..51 '1u32': u32 - 58..68 'id::': fn id(i128) -> i128 - 58..71 'id::(1)': i128 - 69..70 '1': i128 - 81..82 'x': u64 - 90..92 'id': fn id(u64) -> u64 - 90..95 'id(1)': u64 - 93..94 '1': u64 + 9..10 't': T + 20..25 '{ t }': T + 22..23 't': T + 37..97 '{ ...(1); }': () + 43..45 'id': fn id(u32) -> u32 + 43..51 'id(1u32)': u32 + 46..50 '1u32': u32 + 57..67 'id::': fn id(i128) -> i128 + 57..70 'id::(1)': i128 + 68..69 '1': i128 + 80..81 'x': u64 + 89..91 'id': fn id(u64) -> u64 + 89..94 'id(1)': u64 + 92..93 '1': u64 "### ); } @@ -1355,38 +1355,38 @@ fn test() -> i128 { } "#), @r###" - 74..78 'self': A - 85..107 '{ ... }': X - 95..99 'self': A - 95..101 'self.x': X - 117..121 'self': A - 128..150 '{ ... }': Y - 138..142 'self': A - 138..144 'self.y': Y - 163..167 'self': A - 169..170 't': T - 188..223 '{ ... }': (X, Y, T) - 198..217 '(self.....y, t)': (X, Y, T) - 199..203 'self': A - 199..205 'self.x': X - 207..211 'self': A - 207..213 'self.y': Y - 215..216 't': T - 245..342 '{ ...(1); }': () - 255..256 'a': A - 259..281 'A { x:...1i64 }': A - 266..270 '1u64': u64 - 275..279 '1i64': i64 - 287..288 'a': A - 287..292 'a.x()': u64 - 298..299 'a': A - 298..303 'a.y()': i64 - 309..310 'a': A - 309..319 'a.z(1i128)': (u64, i64, i128) - 313..318 '1i128': i128 - 325..326 'a': A - 325..339 'a.z::(1)': (u64, i64, u128) - 337..338 '1': u128 + 73..77 'self': A + 84..106 '{ ... }': X + 94..98 'self': A + 94..100 'self.x': X + 116..120 'self': A + 127..149 '{ ... }': Y + 137..141 'self': A + 137..143 'self.y': Y + 162..166 'self': A + 168..169 't': T + 187..222 '{ ... }': (X, Y, T) + 197..216 '(self.....y, t)': (X, Y, T) + 198..202 'self': A + 198..204 'self.x': X + 206..210 'self': A + 206..212 'self.y': Y + 214..215 't': T + 244..341 '{ ...(1); }': () + 254..255 'a': A + 258..280 'A { x:...1i64 }': A + 265..269 '1u64': u64 + 274..278 '1i64': i64 + 286..287 'a': A + 286..291 'a.x()': u64 + 297..298 'a': A + 297..302 'a.y()': i64 + 308..309 'a': A + 308..318 'a.z(1i128)': (u64, i64, i128) + 312..317 '1i128': i128 + 324..325 'a': A + 324..338 'a.z::(1)': (u64, i64, u128) + 336..337 '1': u128 "### ); } @@ -1408,15 +1408,15 @@ fn test(o: Option) { } "#), @r###" - 78..82 'self': &Option - 98..100 '{}': () - 111..112 'o': Option - 127..165 '{ ...f(); }': () - 133..146 '(&o).as_ref()': Option<&u32> - 134..136 '&o': &Option - 135..136 'o': Option - 152..153 'o': Option - 152..162 'o.as_ref()': Option<&u32> + 77..81 'self': &Option + 97..99 '{}': () + 110..111 'o': Option + 126..164 '{ ...f(); }': () + 132..145 '(&o).as_ref()': Option<&u32> + 133..135 '&o': &Option + 134..135 'o': Option + 151..152 'o': Option + 151..161 'o.as_ref()': Option<&u32> "### ); } @@ -1445,35 +1445,35 @@ fn test() -> i128 { } "#), @r###" - 53..57 'self': A - 65..87 '{ ... }': T2 - 75..79 'self': A - 75..81 'self.x': T2 - 99..100 't': T - 110..115 '{ t }': T - 112..113 't': T - 135..261 '{ ....x() }': i128 - 146..147 'x': i128 - 150..151 '1': i128 - 162..163 'y': i128 - 166..168 'id': fn id(i128) -> i128 - 166..171 'id(x)': i128 - 169..170 'x': i128 - 182..183 'a': A - 186..200 'A { x: id(y) }': A - 193..195 'id': fn id(i128) -> i128 - 193..198 'id(y)': i128 - 196..197 'y': i128 - 211..212 'z': i128 - 215..217 'id': fn id(i128) -> i128 - 215..222 'id(a.x)': i128 - 218..219 'a': A - 218..221 'a.x': i128 - 233..234 'b': A - 237..247 'A { x: z }': A - 244..245 'z': i128 - 254..255 'b': A - 254..259 'b.x()': i128 + 52..56 'self': A + 64..86 '{ ... }': T2 + 74..78 'self': A + 74..80 'self.x': T2 + 98..99 't': T + 109..114 '{ t }': T + 111..112 't': T + 134..260 '{ ....x() }': i128 + 145..146 'x': i128 + 149..150 '1': i128 + 161..162 'y': i128 + 165..167 'id': fn id(i128) -> i128 + 165..170 'id(x)': i128 + 168..169 'x': i128 + 181..182 'a': A + 185..199 'A { x: id(y) }': A + 192..194 'id': fn id(i128) -> i128 + 192..197 'id(y)': i128 + 195..196 'y': i128 + 210..211 'z': i128 + 214..216 'id': fn id(i128) -> i128 + 214..221 'id(a.x)': i128 + 217..218 'a': A + 217..220 'a.x': i128 + 232..233 'b': A + 236..246 'A { x: z }': A + 243..244 'z': i128 + 253..254 'b': A + 253..258 'b.x()': i128 "### ); } @@ -1511,16 +1511,16 @@ fn test() { } "#), @r###" - 52..53 '1': u32 - 105..106 '2': u32 - 213..214 '5': u32 - 229..307 '{ ...:ID; }': () - 239..240 'x': u32 - 243..254 'Struct::FOO': u32 - 264..265 'y': u32 - 268..277 'Enum::BAR': u32 - 287..288 'z': u32 - 291..304 'TraitTest::ID': u32 + 51..52 '1': u32 + 104..105 '2': u32 + 212..213 '5': u32 + 228..306 '{ ...:ID; }': () + 238..239 'x': u32 + 242..253 'Struct::FOO': u32 + 263..264 'y': u32 + 267..276 'Enum::BAR': u32 + 286..287 'z': u32 + 290..303 'TraitTest::ID': u32 "### ); } @@ -1543,22 +1543,22 @@ fn test(x: Foo, y: Bar<&str>, z: Baz) { } "#), @r###" - 116..117 'x': A - 124..125 'y': A<&str, u128> - 138..139 'z': A - 154..211 '{ ...z.y; }': () - 160..161 'x': A - 160..163 'x.x': u32 - 169..170 'x': A - 169..172 'x.y': i128 - 178..179 'y': A<&str, u128> - 178..181 'y.x': &str - 187..188 'y': A<&str, u128> - 187..190 'y.y': u128 - 196..197 'z': A - 196..199 'z.x': u8 - 205..206 'z': A - 205..208 'z.y': i8 + 115..116 'x': A + 123..124 'y': A<&str, u128> + 137..138 'z': A + 153..210 '{ ...z.y; }': () + 159..160 'x': A + 159..162 'x.x': u32 + 168..169 'x': A + 168..171 'x.y': i128 + 177..178 'y': A<&str, u128> + 177..180 'y.x': &str + 186..187 'y': A<&str, u128> + 186..189 'y.y': u128 + 195..196 'z': A + 195..198 'z.x': u8 + 204..205 'z': A + 204..207 'z.y': i8 "### ) } @@ -1573,8 +1573,8 @@ type Bar = A; fn test(x: Foo) {} "#), @r###" - 59..60 'x': {unknown} - 67..69 '{}': () + 58..59 'x': {unknown} + 66..68 '{}': () "### ) } @@ -1599,26 +1599,26 @@ fn test() { } "#), @r###" - 10..11 'x': T - 21..30 '{ x }': T - 27..28 'x': T - 44..45 'x': &T - 56..66 '{ *x }': T - 62..64 '*x': T - 63..64 'x': &T - 78..158 '{ ...(1); }': () - 88..89 'y': u32 - 92..97 '10u32': u32 - 103..105 'id': fn id(u32) -> u32 - 103..108 'id(y)': u32 - 106..107 'y': u32 - 118..119 'x': bool - 128..133 'clone': fn clone(&bool) -> bool - 128..136 'clone(z)': bool - 134..135 'z': &bool - 142..152 'id::': fn id(i128) -> i128 - 142..155 'id::(1)': i128 - 153..154 '1': i128 + 9..10 'x': T + 20..29 '{ x }': T + 26..27 'x': T + 43..44 'x': &T + 55..65 '{ *x }': T + 61..63 '*x': T + 62..63 'x': &T + 77..157 '{ ...(1); }': () + 87..88 'y': u32 + 91..96 '10u32': u32 + 102..104 'id': fn id(u32) -> u32 + 102..107 'id(y)': u32 + 105..106 'y': u32 + 117..118 'x': bool + 127..132 'clone': fn clone(&bool) -> bool + 127..135 'clone(z)': bool + 133..134 'z': &bool + 141..151 'id::': fn id(i128) -> i128 + 141..154 'id::(1)': i128 + 152..153 '1': i128 "### ); } @@ -1638,16 +1638,16 @@ fn test() { } "#), @r###" - 49..50 '0': u32 - 80..83 '101': u32 - 95..213 '{ ...NST; }': () - 138..139 'x': u32 - 142..153 'LOCAL_CONST': u32 - 163..164 'z': u32 - 167..179 'GLOBAL_CONST': u32 - 189..191 'id': u32 - 194..210 'Foo::A..._CONST': u32 - 126..128 '99': u32 + 48..49 '0': u32 + 79..82 '101': u32 + 94..212 '{ ...NST; }': () + 137..138 'x': u32 + 141..152 'LOCAL_CONST': u32 + 162..163 'z': u32 + 166..178 'GLOBAL_CONST': u32 + 188..190 'id': u32 + 193..209 'Foo::A..._CONST': u32 + 125..127 '99': u32 "### ); } @@ -1668,19 +1668,19 @@ fn test() { } "#), @r###" - 29..32 '101': u32 - 70..73 '101': u32 - 85..280 '{ ...MUT; }': () - 173..174 'x': u32 - 177..189 'LOCAL_STATIC': u32 - 199..200 'y': u32 - 203..219 'LOCAL_...IC_MUT': u32 - 229..230 'z': u32 - 233..246 'GLOBAL_STATIC': u32 - 256..257 'w': u32 - 260..277 'GLOBAL...IC_MUT': u32 - 118..120 '99': u32 - 161..163 '99': u32 + 28..31 '101': u32 + 69..72 '101': u32 + 84..279 '{ ...MUT; }': () + 172..173 'x': u32 + 176..188 'LOCAL_STATIC': u32 + 198..199 'y': u32 + 202..218 'LOCAL_...IC_MUT': u32 + 228..229 'z': u32 + 232..245 'GLOBAL_STATIC': u32 + 255..256 'w': u32 + 259..276 'GLOBAL...IC_MUT': u32 + 117..119 '99': u32 + 160..162 '99': u32 "### ); } @@ -1748,12 +1748,12 @@ fn foo() -> u32 { } "#), @r###" - 17..59 '{ ...; }; }': () - 27..28 'x': || -> usize - 31..56 '|| -> ...n 1; }': || -> usize - 43..56 '{ return 1; }': usize - 45..53 'return 1': ! - 52..53 '1': usize + 16..58 '{ ...; }; }': () + 26..27 'x': || -> usize + 30..55 '|| -> ...n 1; }': || -> usize + 42..55 '{ return 1; }': usize + 44..52 'return 1': ! + 51..52 '1': usize "### ); } @@ -1767,11 +1767,11 @@ fn foo() -> u32 { } "#), @r###" - 17..48 '{ ...; }; }': () - 27..28 'x': || -> () - 31..45 '|| { return; }': || -> () - 34..45 '{ return; }': () - 36..42 'return': ! + 16..47 '{ ...; }; }': () + 26..27 'x': || -> () + 30..44 '|| { return; }': || -> () + 33..44 '{ return; }': () + 35..41 'return': ! "### ); } @@ -1785,11 +1785,11 @@ fn foo() -> u32 { } "#), @r###" - 17..47 '{ ..." }; }': () - 27..28 'x': || -> &str - 31..44 '|| { "test" }': || -> &str - 34..44 '{ "test" }': &str - 36..42 '"test"': &str + 16..46 '{ ..." }; }': () + 26..27 'x': || -> &str + 30..43 '|| { "test" }': || -> &str + 33..43 '{ "test" }': &str + 35..41 '"test"': &str "### ); } @@ -1808,14 +1808,14 @@ fn main() { } "#), @r###" - 48..121 '{ ...hod; }': () - 58..64 'vtable': Vtable - 67..91 'Vtable...| {} }': Vtable - 84..89 '|| {}': || -> () - 87..89 '{}': () - 101..102 'm': fn() - 105..111 'vtable': Vtable - 105..118 'vtable.method': fn() + 47..120 '{ ...hod; }': () + 57..63 'vtable': Vtable + 66..90 'Vtable...| {} }': Vtable + 83..88 '|| {}': || -> () + 86..88 '{}': () + 100..101 'm': fn() + 104..110 'vtable': Vtable + 104..117 'vtable.method': fn() "### ); } @@ -1832,22 +1832,22 @@ fn main() { } "#), @r###" - 11..131 '{ ...2 }; }': () - 21..22 'x': i32 - 32..38 '{ 92 }': i32 - 34..36 '92': i32 - 48..49 'y': {unknown} - 58..80 '{ asyn...wait }': {unknown} - 60..78 'async ....await': {unknown} - 66..72 '{ () }': () - 68..70 '()': () - 90..91 'z': {unknown} - 94..104 'try { () }': {unknown} - 98..104 '{ () }': () - 100..102 '()': () - 114..115 't': i32 - 122..128 '{ 92 }': i32 - 124..126 '92': i32 + 10..130 '{ ...2 }; }': () + 20..21 'x': i32 + 31..37 '{ 92 }': i32 + 33..35 '92': i32 + 47..48 'y': {unknown} + 57..79 '{ asyn...wait }': {unknown} + 59..77 'async ....await': {unknown} + 65..71 '{ () }': () + 67..69 '()': () + 89..90 'z': {unknown} + 93..103 'try { () }': {unknown} + 97..103 '{ () }': () + 99..101 '()': () + 113..114 't': i32 + 121..127 '{ 92 }': i32 + 123..125 '92': i32 "### ) } @@ -1867,16 +1867,16 @@ fn test() { } "#), @r###" - 60..130 '{ ... } }': () - 70..77 'mut end': Option - 80..84 'None': Option - 90..128 'loop {... }': ! - 95..128 '{ ... }': () - 105..108 'end': Option - 105..121 'end = ...(true)': () - 111..115 'Some': Some(bool) -> Option - 111..121 'Some(true)': Option - 116..120 'true': bool + 59..129 '{ ... } }': () + 69..76 'mut end': Option + 79..83 'None': Option + 89..127 'loop {... }': ! + 94..127 '{ ... }': () + 104..107 'end': Option + 104..120 'end = ...(true)': () + 110..114 'Some': Some(bool) -> Option + 110..120 'Some(true)': Option + 115..119 'true': bool "### ); } @@ -1899,19 +1899,19 @@ fn test() { } "#), @r###" - 60..169 '{ ... }; }': () - 70..71 'x': Option - 74..166 'loop {... }': Option - 79..166 '{ ... }': () - 89..133 'if fal... }': () - 92..97 'false': bool - 98..133 '{ ... }': () - 112..122 'break None': ! - 118..122 'None': Option - 143..159 'break ...(true)': ! - 149..153 'Some': Some(bool) -> Option - 149..159 'Some(true)': Option - 154..158 'true': bool + 59..168 '{ ... }; }': () + 69..70 'x': Option + 73..165 'loop {... }': Option + 78..165 '{ ... }': () + 88..132 'if fal... }': () + 91..96 'false': bool + 97..132 '{ ... }': () + 111..121 'break None': ! + 117..121 'None': Option + 142..158 'break ...(true)': ! + 148..152 'Some': Some(bool) -> Option + 148..158 'Some(true)': Option + 153..157 'true': bool "### ); } @@ -1932,14 +1932,14 @@ fn test() { } "#), @r###" - 60..137 '{ ... }; }': () - 70..71 'x': () - 74..134 'loop {... }': () - 79..134 '{ ... }': () - 89..128 'if fal... }': () - 92..97 'false': bool - 98..128 '{ ... }': () - 112..117 'break': ! + 59..136 '{ ... }; }': () + 69..70 'x': () + 73..133 'loop {... }': () + 78..133 '{ ... }': () + 88..127 'if fal... }': () + 91..96 'false': bool + 97..127 '{ ... }': () + 111..116 'break': ! "### ); } @@ -1964,36 +1964,36 @@ fn foo() { } "#), @r###" - 10..336 '{ ... }; }': () - 20..22 '_x': || -> bool - 25..333 '|| 'ou... }': || -> bool - 28..333 ''outer... }': bool - 41..333 '{ ... }': () - 55..60 'inner': i8 - 63..301 ''inner... }': i8 - 76..301 '{ ... }': () - 94..95 'i': bool - 98..114 'Defaul...efault': {unknown} - 98..116 'Defaul...ault()': bool - 130..270 'if (br... }': () - 134..148 'break 'outer i': ! - 147..148 'i': bool - 150..209 '{ ... }': () - 168..194 'loop {...5i8; }': ! - 173..194 '{ brea...5i8; }': () - 175..191 'break ...er 5i8': ! - 188..191 '5i8': i8 - 215..270 'if tru... }': () - 218..222 'true': bool - 223..270 '{ ... }': () - 241..255 'break 'inner 6': ! - 254..255 '6': i8 - 283..290 'break 7': ! - 289..290 '7': i8 - 311..326 'break inner < 8': ! - 317..322 'inner': i8 - 317..326 'inner < 8': bool - 325..326 '8': i8 + 9..335 '{ ... }; }': () + 19..21 '_x': || -> bool + 24..332 '|| 'ou... }': || -> bool + 27..332 ''outer... }': bool + 40..332 '{ ... }': () + 54..59 'inner': i8 + 62..300 ''inner... }': i8 + 75..300 '{ ... }': () + 93..94 'i': bool + 97..113 'Defaul...efault': {unknown} + 97..115 'Defaul...ault()': bool + 129..269 'if (br... }': () + 133..147 'break 'outer i': ! + 146..147 'i': bool + 149..208 '{ ... }': () + 167..193 'loop {...5i8; }': ! + 172..193 '{ brea...5i8; }': () + 174..190 'break ...er 5i8': ! + 187..190 '5i8': i8 + 214..269 'if tru... }': () + 217..221 'true': bool + 222..269 '{ ... }': () + 240..254 'break 'inner 6': ! + 253..254 '6': i8 + 282..289 'break 7': ! + 288..289 '7': i8 + 310..325 'break inner < 8': ! + 316..321 'inner': i8 + 316..325 'inner < 8': bool + 324..325 '8': i8 "### ); } @@ -2022,35 +2022,35 @@ fn test(t1: Thing, t2: OtherThing, t3: Thing, t4: OtherThing) { } "#), @r###" - 98..100 't1': Thing<()> - 109..111 't2': OtherThing<()> - 125..127 't3': Thing - 141..143 't4': OtherThing - 162..385 '{ ... } }': () - 168..170 't1': Thing<()> - 168..172 't1.t': () - 178..180 't3': Thing - 178..182 't3.t': i32 - 188..283 'match ... }': () - 194..196 't2': OtherThing<()> - 207..228 'OtherT... { t }': OtherThing<()> - 225..226 't': () - 232..238 '{ t; }': () - 234..235 't': () - 248..266 'OtherT...Two(t)': OtherThing<()> - 264..265 't': () - 270..276 '{ t; }': () - 272..273 't': () - 288..383 'match ... }': () - 294..296 't4': OtherThing - 307..328 'OtherT... { t }': OtherThing - 325..326 't': i32 - 332..338 '{ t; }': () - 334..335 't': i32 - 348..366 'OtherT...Two(t)': OtherThing - 364..365 't': i32 - 370..376 '{ t; }': () - 372..373 't': i32 + 97..99 't1': Thing<()> + 108..110 't2': OtherThing<()> + 124..126 't3': Thing + 140..142 't4': OtherThing + 161..384 '{ ... } }': () + 167..169 't1': Thing<()> + 167..171 't1.t': () + 177..179 't3': Thing + 177..181 't3.t': i32 + 187..282 'match ... }': () + 193..195 't2': OtherThing<()> + 206..227 'OtherT... { t }': OtherThing<()> + 224..225 't': () + 231..237 '{ t; }': () + 233..234 't': () + 247..265 'OtherT...Two(t)': OtherThing<()> + 263..264 't': () + 269..275 '{ t; }': () + 271..272 't': () + 287..382 'match ... }': () + 293..295 't4': OtherThing + 306..327 'OtherT... { t }': OtherThing + 324..325 't': i32 + 331..337 '{ t; }': () + 333..334 't': i32 + 347..365 'OtherT...Two(t)': OtherThing + 363..364 't': i32 + 369..375 '{ t; }': () + 371..372 't': i32 "### ); } @@ -2078,30 +2078,30 @@ fn test() { } "#), @r###" - 100..320 '{ ...32); }': () - 110..111 'x': Thing - 114..134 'Thing ...p {} }': Thing - 125..132 'loop {}': ! - 130..132 '{}': () - 144..145 'y': Thing<()> - 148..163 'Thing { t: () }': Thing<()> - 159..161 '()': () - 173..174 'z': Thing - 177..194 'Thing ...1i32 }': Thing - 188..192 '1i32': i32 - 200..241 'if let... }': () - 207..218 'Thing { t }': Thing - 215..216 't': i32 - 221..222 'z': Thing - 223..241 '{ ... }': () - 233..234 't': i32 - 251..252 'a': OtherThing - 255..282 'OtherT...1i32 }': OtherThing - 276..280 '1i32': i32 - 292..293 'b': OtherThing - 296..311 'OtherThing::Two': Two(i32) -> OtherThing - 296..317 'OtherT...(1i32)': OtherThing - 312..316 '1i32': i32 + 99..319 '{ ...32); }': () + 109..110 'x': Thing + 113..133 'Thing ...p {} }': Thing + 124..131 'loop {}': ! + 129..131 '{}': () + 143..144 'y': Thing<()> + 147..162 'Thing { t: () }': Thing<()> + 158..160 '()': () + 172..173 'z': Thing + 176..193 'Thing ...1i32 }': Thing + 187..191 '1i32': i32 + 199..240 'if let... }': () + 206..217 'Thing { t }': Thing + 214..215 't': i32 + 220..221 'z': Thing + 222..240 '{ ... }': () + 232..233 't': i32 + 250..251 'a': OtherThing + 254..281 'OtherT...1i32 }': OtherThing + 275..279 '1i32': i32 + 291..292 'b': OtherThing + 295..310 'OtherThing::Two': Two(i32) -> OtherThing + 295..316 'OtherT...(1i32)': OtherThing + 311..315 '1i32': i32 "### ); } diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index 961be4abdf..646e1715c1 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs @@ -259,16 +259,16 @@ fn test() { } "#), @r###" - 86..87 't': T - 92..94 '{}': () - 105..144 '{ ...(s); }': () - 115..116 's': S - 119..120 'S': S(u32) -> S - 119..129 'S(unknown)': S - 121..128 'unknown': u32 - 135..138 'foo': fn foo>(S) - 135..141 'foo(s)': () - 139..140 's': S + 85..86 't': T + 91..93 '{}': () + 104..143 '{ ...(s); }': () + 114..115 's': S + 118..119 'S': S(u32) -> S + 118..128 'S(unknown)': S + 120..127 'unknown': u32 + 134..137 'foo': fn foo>(S) + 134..140 'foo(s)': () + 138..139 's': S "### ); } @@ -287,17 +287,17 @@ fn test() { } "#), @r###" - 87..88 't': T - 98..100 '{}': () - 111..163 '{ ...(s); }': () - 121..122 's': S - 125..126 'S': S(u32) -> S - 125..135 'S(unknown)': S - 127..134 'unknown': u32 - 145..146 'x': u32 - 154..157 'foo': fn foo>(S) -> u32 - 154..160 'foo(s)': u32 - 158..159 's': S + 86..87 't': T + 97..99 '{}': () + 110..162 '{ ...(s); }': () + 120..121 's': S + 124..125 'S': S(u32) -> S + 124..134 'S(unknown)': S + 126..133 'unknown': u32 + 144..145 'x': u32 + 153..156 'foo': fn foo>(S) -> u32 + 153..159 'foo(s)': u32 + 157..158 's': S "### ); } @@ -315,12 +315,12 @@ trait Trait { } "#), @r###" - 27..31 'self': &Self - 53..57 'self': &Self - 62..97 '{ ... }': () - 76..77 'x': i64 - 80..84 'self': &Self - 80..90 'self.foo()': i64 + 26..30 'self': &Self + 52..56 'self': &Self + 61..96 '{ ... }': () + 75..76 'x': i64 + 79..83 'self': &Self + 79..89 'self.foo()': i64 "### ); } @@ -339,12 +339,12 @@ trait Trait: SuperTrait { } "#), @r###" - 32..36 'self': &Self - 86..90 'self': &Self - 95..130 '{ ... }': () - 109..110 'x': i64 - 113..117 'self': &Self - 113..123 'self.foo()': i64 + 31..35 'self': &Self + 85..89 'self': &Self + 94..129 '{ ... }': () + 108..109 'x': i64 + 112..116 'self': &Self + 112..122 'self.foo()': i64 "### ); } @@ -366,15 +366,15 @@ fn test() { } "#), @r###" - 108..261 '{ ...ter; }': () - 118..119 'x': u32 - 145..146 '1': u32 - 156..157 'y': Iterable::Item - 183..192 'no_matter': Iterable::Item - 202..203 'z': Iterable::Item - 215..224 'no_matter': Iterable::Item - 234..235 'a': Iterable::Item - 249..258 'no_matter': Iterable::Item + 107..260 '{ ...ter; }': () + 117..118 'x': u32 + 144..145 '1': u32 + 155..156 'y': Iterable::Item + 182..191 'no_matter': Iterable::Item + 201..202 'z': Iterable::Item + 214..223 'no_matter': Iterable::Item + 233..234 'a': Iterable::Item + 248..257 'no_matter': Iterable::Item "### ); } @@ -398,25 +398,25 @@ fn test() { } "#), @r###" - 106..107 't': T - 123..125 '{}': () - 147..148 't': T - 178..180 '{}': () - 202..203 't': T - 221..223 '{}': () - 234..300 '{ ...(S); }': () - 244..245 'x': u32 - 248..252 'foo1': fn foo1(S) -> ::Item - 248..255 'foo1(S)': u32 - 253..254 'S': S - 265..266 'y': u32 - 269..273 'foo2': fn foo2(S) -> ::Item - 269..276 'foo2(S)': u32 - 274..275 'S': S - 286..287 'z': u32 - 290..294 'foo3': fn foo3(S) -> ::Item - 290..297 'foo3(S)': u32 - 295..296 'S': S + 105..106 't': T + 122..124 '{}': () + 146..147 't': T + 177..179 '{}': () + 201..202 't': T + 220..222 '{}': () + 233..299 '{ ...(S); }': () + 243..244 'x': u32 + 247..251 'foo1': fn foo1(S) -> ::Item + 247..254 'foo1(S)': u32 + 252..253 'S': S + 264..265 'y': u32 + 268..272 'foo2': fn foo2(S) -> ::Item + 268..275 'foo2(S)': u32 + 273..274 'S': S + 285..286 'z': u32 + 289..293 'foo3': fn foo3(S) -> ::Item + 289..296 'foo3(S)': u32 + 294..295 'S': S "### ); } @@ -433,9 +433,9 @@ fn test>() { } "#), @r###" - 67..100 '{ ...own; }': () - 77..78 'y': u32 - 90..97 'unknown': u32 + 66..99 '{ ...own; }': () + 76..77 'y': u32 + 89..96 'unknown': u32 "### ); } @@ -448,13 +448,13 @@ const A: u32 = 1 + 1; static B: u64 = { let x = 1; x }; "#), @r###" - 16..17 '1': u32 - 16..21 '1 + 1': u32 - 20..21 '1': u32 - 39..55 '{ let ...1; x }': u64 - 45..46 'x': u64 - 49..50 '1': u64 - 52..53 'x': u64 + 15..16 '1': u32 + 15..20 '1 + 1': u32 + 19..20 '1': u32 + 38..54 '{ let ...1; x }': u64 + 44..45 'x': u64 + 48..49 '1': u64 + 51..52 'x': u64 "### ); } @@ -471,17 +471,17 @@ fn test() -> u64 { } "#), @r###" - 38..87 '{ ... a.1 }': u64 - 48..49 'a': S - 52..53 'S': S(i32, u64) -> S - 52..59 'S(4, 6)': S - 54..55 '4': i32 - 57..58 '6': u64 - 69..70 'b': i32 - 73..74 'a': S - 73..76 'a.0': i32 - 82..83 'a': S - 82..85 'a.1': u64 + 37..86 '{ ... a.1 }': u64 + 47..48 'a': S + 51..52 'S': S(i32, u64) -> S + 51..58 'S(4, 6)': S + 53..54 '4': i32 + 56..57 '6': u64 + 68..69 'b': i32 + 72..73 'a': S + 72..75 'a.0': i32 + 81..82 'a': S + 81..84 'a.1': u64 "### ); } @@ -498,24 +498,24 @@ fn test() -> u64 { } "#), @r###" - 44..102 '{ ...0(2) }': u64 - 54..55 'a': S - 58..59 'S': S(fn(u32) -> u64) -> S - 58..68 'S(|i| 2*i)': S - 60..67 '|i| 2*i': |u32| -> u64 - 61..62 'i': u32 - 64..65 '2': u32 - 64..67 '2*i': u32 - 66..67 'i': u32 - 78..79 'b': u64 - 82..83 'a': S - 82..85 'a.0': fn(u32) -> u64 - 82..88 'a.0(4)': u64 - 86..87 '4': u32 - 94..95 'a': S - 94..97 'a.0': fn(u32) -> u64 - 94..100 'a.0(2)': u64 - 98..99 '2': u32 + 43..101 '{ ...0(2) }': u64 + 53..54 'a': S + 57..58 'S': S(fn(u32) -> u64) -> S + 57..67 'S(|i| 2*i)': S + 59..66 '|i| 2*i': |u32| -> u64 + 60..61 'i': u32 + 63..64 '2': u32 + 63..66 '2*i': u32 + 65..66 'i': u32 + 77..78 'b': u64 + 81..82 'a': S + 81..84 'a.0': fn(u32) -> u64 + 81..87 'a.0(4)': u64 + 85..86 '4': u32 + 93..94 'a': S + 93..96 'a.0': fn(u32) -> u64 + 93..99 'a.0(2)': u64 + 97..98 '2': u32 "### ); } @@ -946,34 +946,34 @@ fn test(x: impl Trait, y: &impl Trait) { } "#, true), @r###" - 30..34 'self': &Self - 55..59 'self': &Self - 78..79 'x': impl Trait - 98..100 '{}': () - 155..156 'x': impl Trait - 175..176 'y': &impl Trait - 196..324 '{ ...2(); }': () - 202..203 'x': impl Trait - 209..210 'y': &impl Trait - 220..221 'z': S - 224..225 'S': S(u16) -> S - 224..228 'S(1)': S - 226..227 '1': u16 - 234..237 'bar': fn bar(S) - 234..240 'bar(z)': () - 238..239 'z': S - 246..247 'x': impl Trait - 246..253 'x.foo()': u64 - 259..260 'y': &impl Trait - 259..266 'y.foo()': u32 - 272..273 'z': S - 272..279 'z.foo()': u16 - 285..286 'x': impl Trait - 285..293 'x.foo2()': i64 - 299..300 'y': &impl Trait - 299..307 'y.foo2()': i64 - 313..314 'z': S - 313..321 'z.foo2()': i64 + 29..33 'self': &Self + 54..58 'self': &Self + 77..78 'x': impl Trait + 97..99 '{}': () + 154..155 'x': impl Trait + 174..175 'y': &impl Trait + 195..323 '{ ...2(); }': () + 201..202 'x': impl Trait + 208..209 'y': &impl Trait + 219..220 'z': S + 223..224 'S': S(u16) -> S + 223..227 'S(1)': S + 225..226 '1': u16 + 233..236 'bar': fn bar(S) + 233..239 'bar(z)': () + 237..238 'z': S + 245..246 'x': impl Trait + 245..252 'x.foo()': u64 + 258..259 'y': &impl Trait + 258..265 'y.foo()': u32 + 271..272 'z': S + 271..278 'z.foo()': u16 + 284..285 'x': impl Trait + 284..292 'x.foo2()': i64 + 298..299 'y': &impl Trait + 298..306 'y.foo2()': i64 + 312..313 'z': S + 312..320 'z.foo2()': i64 "### ); } @@ -1007,39 +1007,39 @@ fn test() { } "#, true), @r###" - 156..157 'x': impl Trait - 176..187 '{ loop {} }': T - 178..185 'loop {}': ! - 183..185 '{}': () - 200..201 'x': impl Trait - 220..231 '{ loop {} }': T - 222..229 'loop {}': ! - 227..229 '{}': () - 301..510 '{ ... i32 }': () - 307..315 'Foo::bar': fn bar<{unknown}, {unknown}>(S) -> {unknown} - 307..318 'Foo::bar(S)': {unknown} - 316..317 'S': S - 324..339 '::bar': fn bar(S) -> {unknown} - 324..342 '(S) -> {unknown} - 348..357 'F::bar(S)': {unknown} - 355..356 'S': S - 363..378 'Foo::bar::': fn bar<{unknown}, u32>(S) -> u32 - 363..381 'Foo::b...32>(S)': u32 - 379..380 'S': S - 387..409 '': fn bar(S) -> u32 - 387..412 '(S)': u32 - 410..411 'S': S - 419..422 'foo': fn foo<{unknown}>(S) -> {unknown} - 419..425 'foo(S)': {unknown} - 423..424 'S': S - 431..441 'foo::': fn foo(S) -> u32 - 431..444 'foo::(S)': u32 - 442..443 'S': S - 450..465 'foo::': fn foo(S) -> u32 - 450..468 'foo::<...32>(S)': u32 - 466..467 'S': S + 155..156 'x': impl Trait + 175..186 '{ loop {} }': T + 177..184 'loop {}': ! + 182..184 '{}': () + 199..200 'x': impl Trait + 219..230 '{ loop {} }': T + 221..228 'loop {}': ! + 226..228 '{}': () + 300..509 '{ ... i32 }': () + 306..314 'Foo::bar': fn bar<{unknown}, {unknown}>(S) -> {unknown} + 306..317 'Foo::bar(S)': {unknown} + 315..316 'S': S + 323..338 '::bar': fn bar(S) -> {unknown} + 323..341 '(S) -> {unknown} + 347..356 'F::bar(S)': {unknown} + 354..355 'S': S + 362..377 'Foo::bar::': fn bar<{unknown}, u32>(S) -> u32 + 362..380 'Foo::b...32>(S)': u32 + 378..379 'S': S + 386..408 '': fn bar(S) -> u32 + 386..411 '(S)': u32 + 409..410 'S': S + 418..421 'foo': fn foo<{unknown}>(S) -> {unknown} + 418..424 'foo(S)': {unknown} + 422..423 'S': S + 430..440 'foo::': fn foo(S) -> u32 + 430..443 'foo::(S)': u32 + 441..442 'S': S + 449..464 'foo::': fn foo(S) -> u32 + 449..467 'foo::<...32>(S)': u32 + 465..466 'S': S "### ); } @@ -1064,24 +1064,24 @@ fn test() { } "#, true), @r###" - 88..92 'self': F - 94..95 'x': impl Trait - 119..130 '{ loop {} }': (T, U) - 121..128 'loop {}': ! - 126..128 '{}': () - 144..284 '{ ...ored }': () - 150..151 'F': F<{unknown}> - 150..158 'F.foo(S)': ({unknown}, {unknown}) - 156..157 'S': S - 164..172 'F::': F - 164..179 'F::.foo(S)': (u32, {unknown}) - 177..178 'S': S - 185..193 'F::': F - 185..207 'F::(S)': (u32, i32) - 205..206 'S': S - 213..221 'F::': F - 213..240 'F::(S)': (u32, i32) - 238..239 'S': S + 87..91 'self': F + 93..94 'x': impl Trait + 118..129 '{ loop {} }': (T, U) + 120..127 'loop {}': ! + 125..127 '{}': () + 143..283 '{ ...ored }': () + 149..150 'F': F<{unknown}> + 149..157 'F.foo(S)': ({unknown}, {unknown}) + 155..156 'S': S + 163..171 'F::': F + 163..178 'F::.foo(S)': (u32, {unknown}) + 176..177 'S': S + 184..192 'F::': F + 184..206 'F::(S)': (u32, i32) + 204..205 'S': S + 212..220 'F::': F + 212..239 'F::(S)': (u32, i32) + 237..238 'S': S "### ); } @@ -1100,13 +1100,13 @@ fn test() { } "#, true), @r###" - 23..24 'x': impl Trait - 38..49 '{ loop {} }': () - 40..47 'loop {}': ! - 45..47 '{}': () - 91..124 '{ ...foo; }': () - 101..102 'f': fn(S) - 118..121 'foo': fn foo(S) + 22..23 'x': impl Trait + 37..48 '{ loop {} }': () + 39..46 'loop {}': ! + 44..46 '{}': () + 90..123 '{ ...foo; }': () + 100..101 'f': fn(S) + 117..120 'foo': fn foo(S) "### ); } @@ -1134,29 +1134,29 @@ fn test(x: impl Trait, y: &impl Trait) { } "#), @r###" - 30..34 'self': &Self - 55..59 'self': &Self - 99..101 '{}': () - 111..112 'x': impl Trait - 131..132 'y': &impl Trait - 152..269 '{ ...2(); }': () - 158..159 'x': impl Trait - 165..166 'y': &impl Trait - 176..177 'z': impl Trait - 180..183 'bar': fn bar() -> impl Trait - 180..185 'bar()': impl Trait - 191..192 'x': impl Trait - 191..198 'x.foo()': u64 - 204..205 'y': &impl Trait - 204..211 'y.foo()': u64 - 217..218 'z': impl Trait - 217..224 'z.foo()': u64 - 230..231 'x': impl Trait - 230..238 'x.foo2()': i64 - 244..245 'y': &impl Trait - 244..252 'y.foo2()': i64 - 258..259 'z': impl Trait - 258..266 'z.foo2()': i64 + 29..33 'self': &Self + 54..58 'self': &Self + 98..100 '{}': () + 110..111 'x': impl Trait + 130..131 'y': &impl Trait + 151..268 '{ ...2(); }': () + 157..158 'x': impl Trait + 164..165 'y': &impl Trait + 175..176 'z': impl Trait + 179..182 'bar': fn bar() -> impl Trait + 179..184 'bar()': impl Trait + 190..191 'x': impl Trait + 190..197 'x.foo()': u64 + 203..204 'y': &impl Trait + 203..210 'y.foo()': u64 + 216..217 'z': impl Trait + 216..223 'z.foo()': u64 + 229..230 'x': impl Trait + 229..237 'x.foo2()': i64 + 243..244 'y': &impl Trait + 243..251 'y.foo2()': i64 + 257..258 'z': impl Trait + 257..265 'z.foo2()': i64 "### ); } @@ -1177,16 +1177,16 @@ fn test() { } "#), @r###" - 30..34 'self': &Self - 72..83 '{ loop {} }': ! - 74..81 'loop {}': ! - 79..81 '{}': () - 95..130 '{ ...o(); }': () - 105..106 'a': impl Trait - 109..112 'bar': fn bar() -> impl Trait - 109..114 'bar()': impl Trait - 120..121 'a': impl Trait - 120..127 'a.foo()': u64 + 29..33 'self': &Self + 71..82 '{ loop {} }': ! + 73..80 'loop {}': ! + 78..80 '{}': () + 94..129 '{ ...o(); }': () + 104..105 'a': impl Trait + 108..111 'bar': fn bar() -> impl Trait + 108..113 'bar()': impl Trait + 119..120 'a': impl Trait + 119..126 'a.foo()': u64 "### ); } @@ -1215,37 +1215,37 @@ fn test() { } "#), @r###" - 50..54 'self': &mut Self - 102..106 'self': &Self - 185..196 '{ loop {} }': ({unknown}, {unknown}) - 187..194 'loop {}': ! - 192..194 '{}': () - 207..208 't': T - 269..280 '{ loop {} }': ({unknown}, {unknown}) - 271..278 'loop {}': ! - 276..278 '{}': () - 292..414 '{ ...o(); }': () - 302..308 '(a, b)': (impl Iterator>, impl Trait) - 303..304 'a': impl Iterator> - 306..307 'b': impl Trait - 311..314 'bar': fn bar() -> (impl Iterator>, impl Trait) - 311..316 'bar()': (impl Iterator>, impl Trait) - 322..323 'a': impl Iterator> - 322..330 'a.next()': impl Trait - 322..336 'a.next().foo()': u32 - 342..343 'b': impl Trait - 342..349 'b.foo()': u64 - 359..365 '(c, d)': (impl Iterator>, impl Trait) - 360..361 'c': impl Iterator> - 363..364 'd': impl Trait - 368..371 'baz': fn baz(u128) -> (impl Iterator>, impl Trait) - 368..378 'baz(1u128)': (impl Iterator>, impl Trait) - 372..377 '1u128': u128 - 384..385 'c': impl Iterator> - 384..392 'c.next()': impl Trait - 384..398 'c.next().foo()': u128 - 404..405 'd': impl Trait - 404..411 'd.foo()': u128 + 49..53 'self': &mut Self + 101..105 'self': &Self + 184..195 '{ loop {} }': ({unknown}, {unknown}) + 186..193 'loop {}': ! + 191..193 '{}': () + 206..207 't': T + 268..279 '{ loop {} }': ({unknown}, {unknown}) + 270..277 'loop {}': ! + 275..277 '{}': () + 291..413 '{ ...o(); }': () + 301..307 '(a, b)': (impl Iterator>, impl Trait) + 302..303 'a': impl Iterator> + 305..306 'b': impl Trait + 310..313 'bar': fn bar() -> (impl Iterator>, impl Trait) + 310..315 'bar()': (impl Iterator>, impl Trait) + 321..322 'a': impl Iterator> + 321..329 'a.next()': impl Trait + 321..335 'a.next().foo()': u32 + 341..342 'b': impl Trait + 341..348 'b.foo()': u64 + 358..364 '(c, d)': (impl Iterator>, impl Trait) + 359..360 'c': impl Iterator> + 362..363 'd': impl Trait + 367..370 'baz': fn baz(u128) -> (impl Iterator>, impl Trait) + 367..377 'baz(1u128)': (impl Iterator>, impl Trait) + 371..376 '1u128': u128 + 383..384 'c': impl Iterator> + 383..391 'c.next()': impl Trait + 383..397 'c.next().foo()': u128 + 403..404 'd': impl Trait + 403..410 'd.foo()': u128 "### ); } @@ -1273,29 +1273,29 @@ fn test(x: dyn Trait, y: &dyn Trait) { } "#), @r###" - 30..34 'self': &Self - 55..59 'self': &Self - 98..100 '{}': () - 110..111 'x': dyn Trait - 129..130 'y': &dyn Trait - 149..266 '{ ...2(); }': () - 155..156 'x': dyn Trait - 162..163 'y': &dyn Trait - 173..174 'z': dyn Trait - 177..180 'bar': fn bar() -> dyn Trait - 177..182 'bar()': dyn Trait - 188..189 'x': dyn Trait - 188..195 'x.foo()': u64 - 201..202 'y': &dyn Trait - 201..208 'y.foo()': u64 - 214..215 'z': dyn Trait - 214..221 'z.foo()': u64 - 227..228 'x': dyn Trait - 227..235 'x.foo2()': i64 - 241..242 'y': &dyn Trait - 241..249 'y.foo2()': i64 - 255..256 'z': dyn Trait - 255..263 'z.foo2()': i64 + 29..33 'self': &Self + 54..58 'self': &Self + 97..99 '{}': () + 109..110 'x': dyn Trait + 128..129 'y': &dyn Trait + 148..265 '{ ...2(); }': () + 154..155 'x': dyn Trait + 161..162 'y': &dyn Trait + 172..173 'z': dyn Trait + 176..179 'bar': fn bar() -> dyn Trait + 176..181 'bar()': dyn Trait + 187..188 'x': dyn Trait + 187..194 'x.foo()': u64 + 200..201 'y': &dyn Trait + 200..207 'y.foo()': u64 + 213..214 'z': dyn Trait + 213..220 'z.foo()': u64 + 226..227 'x': dyn Trait + 226..234 'x.foo2()': i64 + 240..241 'y': &dyn Trait + 240..248 'y.foo2()': i64 + 254..255 'z': dyn Trait + 254..262 'z.foo2()': i64 "### ); } @@ -1321,17 +1321,17 @@ fn test(s: S) { } "#), @r###" - 33..37 'self': &Self - 103..107 'self': &S - 129..140 '{ loop {} }': &dyn Trait - 131..138 'loop {}': ! - 136..138 '{}': () - 176..180 'self': &Self - 252..253 's': S - 268..290 '{ ...z(); }': () - 274..275 's': S - 274..281 's.bar()': &dyn Trait - 274..287 's.bar().baz()': (u32, i32) + 32..36 'self': &Self + 102..106 'self': &S + 128..139 '{ loop {} }': &dyn Trait + 130..137 'loop {}': ! + 135..137 '{}': () + 175..179 'self': &Self + 251..252 's': S + 267..289 '{ ...z(); }': () + 273..274 's': S + 273..280 's.bar()': &dyn Trait + 273..286 's.bar().baz()': (u32, i32) "### ); } @@ -1355,22 +1355,22 @@ fn test(x: Trait, y: &Trait) -> u64 { } "#), @r###" - 27..31 'self': &Self - 61..63 '{}': () - 73..74 'x': dyn Trait - 83..84 'y': &dyn Trait - 101..176 '{ ...o(); }': () - 107..108 'x': dyn Trait - 114..115 'y': &dyn Trait - 125..126 'z': dyn Trait - 129..132 'bar': fn bar() -> dyn Trait - 129..134 'bar()': dyn Trait - 140..141 'x': dyn Trait - 140..147 'x.foo()': u64 - 153..154 'y': &dyn Trait - 153..160 'y.foo()': u64 - 166..167 'z': dyn Trait - 166..173 'z.foo()': u64 + 26..30 'self': &Self + 60..62 '{}': () + 72..73 'x': dyn Trait + 82..83 'y': &dyn Trait + 100..175 '{ ...o(); }': () + 106..107 'x': dyn Trait + 113..114 'y': &dyn Trait + 124..125 'z': dyn Trait + 128..131 'bar': fn bar() -> dyn Trait + 128..133 'bar()': dyn Trait + 139..140 'x': dyn Trait + 139..146 'x.foo()': u64 + 152..153 'y': &dyn Trait + 152..159 'y.foo()': u64 + 165..166 'z': dyn Trait + 165..172 'z.foo()': u64 "### ); } @@ -1384,13 +1384,13 @@ fn test(a: impl Trait + 'lifetime, b: impl 'lifetime, c: impl (Trait), d: impl ( } "#), @r###" - 24..25 'a': impl Trait + {error} - 51..52 'b': impl {error} - 70..71 'c': impl Trait - 87..88 'd': impl {error} - 108..109 'e': impl {error} - 124..125 'f': impl Trait + {error} - 148..151 '{ }': () + 23..24 'a': impl Trait + {error} + 50..51 'b': impl {error} + 69..70 'c': impl Trait + 86..87 'd': impl {error} + 107..108 'e': impl {error} + 123..124 'f': impl Trait + {error} + 147..150 '{ }': () "### ); } @@ -1439,41 +1439,41 @@ fn test>(x: T, y: impl Trait) { } "#), @r###" - 50..51 't': T - 78..80 '{}': () - 112..113 't': T - 123..125 '{}': () - 155..156 't': T - 166..169 '{t}': T - 167..168 't': T - 257..258 'x': T - 263..264 'y': impl Trait - 290..398 '{ ...r>); }': () - 296..299 'get': fn get(T) -> ::Type - 296..302 'get(x)': u32 - 300..301 'x': T - 308..312 'get2': fn get2(T) -> u32 - 308..315 'get2(x)': u32 - 313..314 'x': T - 321..324 'get': fn get>(impl Trait) -> as Trait>::Type - 321..327 'get(y)': i64 - 325..326 'y': impl Trait - 333..337 'get2': fn get2>(impl Trait) -> i64 - 333..340 'get2(y)': i64 - 338..339 'y': impl Trait - 346..349 'get': fn get>(S) -> as Trait>::Type - 346..357 'get(set(S))': u64 - 350..353 'set': fn set>(S) -> S - 350..356 'set(S)': S - 354..355 'S': S - 363..367 'get2': fn get2>(S) -> u64 - 363..375 'get2(set(S))': u64 - 368..371 'set': fn set>(S) -> S - 368..374 'set(S)': S - 372..373 'S': S - 381..385 'get2': fn get2>(S) -> str - 381..395 'get2(S::)': str - 386..394 'S::': S + 49..50 't': T + 77..79 '{}': () + 111..112 't': T + 122..124 '{}': () + 154..155 't': T + 165..168 '{t}': T + 166..167 't': T + 256..257 'x': T + 262..263 'y': impl Trait + 289..397 '{ ...r>); }': () + 295..298 'get': fn get(T) -> ::Type + 295..301 'get(x)': u32 + 299..300 'x': T + 307..311 'get2': fn get2(T) -> u32 + 307..314 'get2(x)': u32 + 312..313 'x': T + 320..323 'get': fn get>(impl Trait) -> as Trait>::Type + 320..326 'get(y)': i64 + 324..325 'y': impl Trait + 332..336 'get2': fn get2>(impl Trait) -> i64 + 332..339 'get2(y)': i64 + 337..338 'y': impl Trait + 345..348 'get': fn get>(S) -> as Trait>::Type + 345..356 'get(set(S))': u64 + 349..352 'set': fn set>(S) -> S + 349..355 'set(S)': S + 353..354 'S': S + 362..366 'get2': fn get2>(S) -> u64 + 362..374 'get2(set(S))': u64 + 367..370 'set': fn set>(S) -> S + 367..373 'set(S)': S + 371..372 'S': S + 380..384 'get2': fn get2>(S) -> str + 380..394 'get2(S::)': str + 385..393 'S::': S "### ); } @@ -1538,11 +1538,11 @@ fn test>(x: T) { } "#), @r###" - 62..66 'self': Self - 164..165 'x': T - 170..186 '{ ...o(); }': () - 176..177 'x': T - 176..183 'x.foo()': u32 + 61..65 'self': Self + 163..164 'x': T + 169..185 '{ ...o(); }': () + 175..176 'x': T + 175..182 'x.foo()': u32 "### ); } @@ -1584,15 +1584,15 @@ fn test(x: T, y: U) { } "#), @r###" - 50..54 'self': &Self - 63..65 '{}': () - 182..183 'x': T - 188..189 'y': U - 194..223 '{ ...o(); }': () - 200..201 'x': T - 200..207 'x.foo()': u32 - 213..214 'y': U - 213..220 'y.foo()': u32 + 49..53 'self': &Self + 62..64 '{}': () + 181..182 'x': T + 187..188 'y': U + 193..222 '{ ...o(); }': () + 199..200 'x': T + 199..206 'x.foo()': u32 + 212..213 'y': U + 212..219 'y.foo()': u32 "### ); } @@ -1613,12 +1613,12 @@ fn test(x: &impl Trait1) { } "#), @r###" - 50..54 'self': &Self - 63..65 '{}': () - 116..117 'x': &impl Trait1 - 133..149 '{ ...o(); }': () - 139..140 'x': &impl Trait1 - 139..146 'x.foo()': u32 + 49..53 'self': &Self + 62..64 '{}': () + 115..116 'x': &impl Trait1 + 132..148 '{ ...o(); }': () + 138..139 'x': &impl Trait1 + 138..145 'x.foo()': u32 "### ); } @@ -1636,10 +1636,10 @@ fn test(x: T) { } "#), @r###" - 44..45 'x': T - 50..66 '{ ...o(); }': () - 56..57 'x': T - 56..63 'x.foo()': {unknown} + 43..44 'x': T + 49..65 '{ ...o(); }': () + 55..56 'x': T + 55..62 'x.foo()': {unknown} "### ); } @@ -1663,17 +1663,17 @@ fn test() { } "#), @r###" - 103..104 't': T - 114..116 '{}': () - 146..147 't': T - 157..160 '{t}': T - 158..159 't': T - 259..280 '{ ...S)); }': () - 265..269 'get2': fn get2>(S) -> u64 - 265..277 'get2(set(S))': u64 - 270..273 'set': fn set>(S) -> S - 270..276 'set(S)': S - 274..275 'S': S + 102..103 't': T + 113..115 '{}': () + 145..146 't': T + 156..159 '{t}': T + 157..158 't': T + 258..279 '{ ...S)); }': () + 264..268 'get2': fn get2>(S) -> u64 + 264..276 'get2(set(S))': u64 + 269..272 'set': fn set>(S) -> S + 269..275 'set(S)': S + 273..274 'S': S "### ); } @@ -1693,15 +1693,15 @@ fn test u128>(f: F) { } "#), @r###" - 57..61 'self': Self - 63..67 'args': Args - 150..151 'f': F - 156..184 '{ ...2)); }': () - 162..163 'f': F - 162..181 'f.call...1, 2))': u128 - 174..180 '(1, 2)': (u32, u64) - 175..176 '1': u32 - 178..179 '2': u64 + 56..60 'self': Self + 62..66 'args': Args + 149..150 'f': F + 155..183 '{ ...2)); }': () + 161..162 'f': F + 161..180 'f.call...1, 2))': u128 + 173..179 '(1, 2)': (u32, u64) + 174..175 '1': u32 + 177..178 '2': u64 "### ); } @@ -1742,24 +1742,24 @@ fn test() { } "#), @r###" -75..79 'self': Self -81..85 'args': Args -140..144 'self': &Self -244..248 'self': &Bar -261..263 '{}': () -347..351 'self': Opt -353..354 'f': F -369..371 '{}': () -385..501 '{ ...(f); }': () -395..398 'bar': Bar u32> -424..427 'bar': Bar u32> -424..433 'bar.foo()': {unknown} -444..447 'opt': Opt -466..467 'f': fn(u8) -> u32 -488..491 'opt': Opt -488..498 'opt.map(f)': Opt u32, (u8,)>> -496..497 'f': fn(u8) -> u32 -"### + 74..78 'self': Self + 80..84 'args': Args + 139..143 'self': &Self + 243..247 'self': &Bar + 260..262 '{}': () + 346..350 'self': Opt + 352..353 'f': F + 368..370 '{}': () + 384..500 '{ ...(f); }': () + 394..397 'bar': Bar u32> + 423..426 'bar': Bar u32> + 423..432 'bar.foo()': {unknown} + 443..446 'opt': Opt + 465..466 'f': fn(u8) -> u32 + 487..490 'opt': Opt + 487..497 'opt.map(f)': Opt u32, (u8,)>> + 495..496 'f': fn(u8) -> u32 + "### ); } @@ -1808,32 +1808,32 @@ fn test() { } "#), @r###" - 65..69 'self': &Self - 166..170 'self': Self - 172..176 'args': Args - 240..244 'self': &Foo - 255..257 '{}': () - 335..336 'f': F - 355..357 '{}': () - 444..690 '{ ...o(); }': () - 454..459 'lazy1': Lazy Foo> - 476..485 'Lazy::new': fn new Foo>(|| -> Foo) -> Lazy Foo> - 476..493 'Lazy::...| Foo)': Lazy Foo> - 486..492 '|| Foo': || -> Foo - 489..492 'Foo': Foo - 503..505 'r1': usize - 508..513 'lazy1': Lazy Foo> - 508..519 'lazy1.foo()': usize - 561..576 'make_foo_fn_ptr': fn() -> Foo - 592..603 'make_foo_fn': fn make_foo_fn() -> Foo - 613..618 'lazy2': Lazy Foo> - 635..644 'Lazy::new': fn new Foo>(fn() -> Foo) -> Lazy Foo> - 635..661 'Lazy::...n_ptr)': Lazy Foo> - 645..660 'make_foo_fn_ptr': fn() -> Foo - 671..673 'r2': {unknown} - 676..681 'lazy2': Lazy Foo> - 676..687 'lazy2.foo()': {unknown} - 550..552 '{}': () + 64..68 'self': &Self + 165..169 'self': Self + 171..175 'args': Args + 239..243 'self': &Foo + 254..256 '{}': () + 334..335 'f': F + 354..356 '{}': () + 443..689 '{ ...o(); }': () + 453..458 'lazy1': Lazy Foo> + 475..484 'Lazy::new': fn new Foo>(|| -> Foo) -> Lazy Foo> + 475..492 'Lazy::...| Foo)': Lazy Foo> + 485..491 '|| Foo': || -> Foo + 488..491 'Foo': Foo + 502..504 'r1': usize + 507..512 'lazy1': Lazy Foo> + 507..518 'lazy1.foo()': usize + 560..575 'make_foo_fn_ptr': fn() -> Foo + 591..602 'make_foo_fn': fn make_foo_fn() -> Foo + 612..617 'lazy2': Lazy Foo> + 634..643 'Lazy::new': fn new Foo>(fn() -> Foo) -> Lazy Foo> + 634..660 'Lazy::...n_ptr)': Lazy Foo> + 644..659 'make_foo_fn_ptr': fn() -> Foo + 670..672 'r2': {unknown} + 675..680 'lazy2': Lazy Foo> + 675..686 'lazy2.foo()': {unknown} + 549..551 '{}': () "### ); } @@ -1860,32 +1860,32 @@ fn test() { } "#), @r###" - 148..152 'self': Option - 154..155 'f': F - 173..175 '{}': () - 189..308 '{ ... 1); }': () - 199..200 'x': Option - 203..215 'Option::Some': Some(u32) -> Option - 203..221 'Option...(1u32)': Option - 216..220 '1u32': u32 - 227..228 'x': Option - 227..243 'x.map(...v + 1)': Option - 233..242 '|v| v + 1': |u32| -> u32 - 234..235 'v': u32 - 237..238 'v': u32 - 237..242 'v + 1': u32 - 241..242 '1': u32 - 249..250 'x': Option - 249..265 'x.map(... 1u64)': Option - 255..264 '|_v| 1u64': |u32| -> u64 - 256..258 '_v': u32 - 260..264 '1u64': u64 - 275..276 'y': Option - 292..293 'x': Option - 292..305 'x.map(|_v| 1)': Option - 298..304 '|_v| 1': |u32| -> i64 - 299..301 '_v': u32 - 303..304 '1': i64 + 147..151 'self': Option + 153..154 'f': F + 172..174 '{}': () + 188..307 '{ ... 1); }': () + 198..199 'x': Option + 202..214 'Option::Some': Some(u32) -> Option + 202..220 'Option...(1u32)': Option + 215..219 '1u32': u32 + 226..227 'x': Option + 226..242 'x.map(...v + 1)': Option + 232..241 '|v| v + 1': |u32| -> u32 + 233..234 'v': u32 + 236..237 'v': u32 + 236..241 'v + 1': u32 + 240..241 '1': u32 + 248..249 'x': Option + 248..264 'x.map(... 1u64)': Option + 254..263 '|_v| 1u64': |u32| -> u64 + 255..257 '_v': u32 + 259..263 '1u64': u64 + 274..275 'y': Option + 291..292 'x': Option + 291..304 'x.map(|_v| 1)': Option + 297..303 '|_v| 1': |u32| -> i64 + 298..300 '_v': u32 + 302..303 '1': i64 "### ); } @@ -1906,26 +1906,26 @@ fn test u64>(f: F) { } "#), @r###" - 73..74 'f': F - 79..155 '{ ...+ v; }': () - 85..86 'f': F - 85..89 'f(1)': {unknown} - 87..88 '1': i32 - 99..100 'g': |u64| -> i32 - 103..112 '|v| v + 1': |u64| -> i32 - 104..105 'v': u64 - 107..108 'v': u64 - 107..112 'v + 1': i32 - 111..112 '1': i32 - 118..119 'g': |u64| -> i32 - 118..125 'g(1u64)': i32 - 120..124 '1u64': u64 - 135..136 'h': |u128| -> u128 - 139..152 '|v| 1u128 + v': |u128| -> u128 - 140..141 'v': u128 - 143..148 '1u128': u128 - 143..152 '1u128 + v': u128 - 151..152 'v': u128 + 72..73 'f': F + 78..154 '{ ...+ v; }': () + 84..85 'f': F + 84..88 'f(1)': {unknown} + 86..87 '1': i32 + 98..99 'g': |u64| -> i32 + 102..111 '|v| v + 1': |u64| -> i32 + 103..104 'v': u64 + 106..107 'v': u64 + 106..111 'v + 1': i32 + 110..111 '1': i32 + 117..118 'g': |u64| -> i32 + 117..124 'g(1u64)': i32 + 119..123 '1u64': u64 + 134..135 'h': |u128| -> u128 + 138..151 '|v| 1u128 + v': |u128| -> u128 + 139..140 'v': u128 + 142..147 '1u128': u128 + 142..151 '1u128 + v': u128 + 150..151 'v': u128 "### ); } @@ -1958,54 +1958,54 @@ fn test() { } "#), @r###" - 95..96 'x': T - 101..102 'f': F - 112..114 '{}': () - 148..149 'f': F - 154..155 'x': T - 165..167 '{}': () - 202..206 'self': S - 254..258 'self': S - 260..261 'x': T - 266..267 'f': F - 277..279 '{}': () - 317..321 'self': S - 323..324 'f': F - 329..330 'x': T - 340..342 '{}': () - 356..515 '{ ... S); }': () - 366..368 'x1': u64 - 371..375 'foo1': fn foo1 u64>(S, |S| -> u64) -> u64 - 371..394 'foo1(S...hod())': u64 - 376..377 'S': S - 379..393 '|s| s.method()': |S| -> u64 - 380..381 's': S - 383..384 's': S - 383..393 's.method()': u64 - 404..406 'x2': u64 - 409..413 'foo2': fn foo2 u64>(|S| -> u64, S) -> u64 - 409..432 'foo2(|...(), S)': u64 - 414..428 '|s| s.method()': |S| -> u64 - 415..416 's': S - 418..419 's': S - 418..428 's.method()': u64 - 430..431 'S': S - 442..444 'x3': u64 - 447..448 'S': S - 447..472 'S.foo1...hod())': u64 - 454..455 'S': S - 457..471 '|s| s.method()': |S| -> u64 - 458..459 's': S - 461..462 's': S - 461..471 's.method()': u64 - 482..484 'x4': u64 - 487..488 'S': S - 487..512 'S.foo2...(), S)': u64 - 494..508 '|s| s.method()': |S| -> u64 - 495..496 's': S - 498..499 's': S - 498..508 's.method()': u64 - 510..511 'S': S + 94..95 'x': T + 100..101 'f': F + 111..113 '{}': () + 147..148 'f': F + 153..154 'x': T + 164..166 '{}': () + 201..205 'self': S + 253..257 'self': S + 259..260 'x': T + 265..266 'f': F + 276..278 '{}': () + 316..320 'self': S + 322..323 'f': F + 328..329 'x': T + 339..341 '{}': () + 355..514 '{ ... S); }': () + 365..367 'x1': u64 + 370..374 'foo1': fn foo1 u64>(S, |S| -> u64) -> u64 + 370..393 'foo1(S...hod())': u64 + 375..376 'S': S + 378..392 '|s| s.method()': |S| -> u64 + 379..380 's': S + 382..383 's': S + 382..392 's.method()': u64 + 403..405 'x2': u64 + 408..412 'foo2': fn foo2 u64>(|S| -> u64, S) -> u64 + 408..431 'foo2(|...(), S)': u64 + 413..427 '|s| s.method()': |S| -> u64 + 414..415 's': S + 417..418 's': S + 417..427 's.method()': u64 + 429..430 'S': S + 441..443 'x3': u64 + 446..447 'S': S + 446..471 'S.foo1...hod())': u64 + 453..454 'S': S + 456..470 '|s| s.method()': |S| -> u64 + 457..458 's': S + 460..461 's': S + 460..470 's.method()': u64 + 481..483 'x4': u64 + 486..487 'S': S + 486..511 'S.foo2...(), S)': u64 + 493..507 '|s| s.method()': |S| -> u64 + 494..495 's': S + 497..498 's': S + 497..507 's.method()': u64 + 509..510 'S': S "### ); } @@ -2080,18 +2080,18 @@ impl Trait for S2 { } "#, ), @r###" - 54..58 'self': &Self - 60..61 'x': Trait::Item - 140..144 'self': &S - 146..147 'x': u32 - 161..175 '{ let y = x; }': () - 167..168 'y': u32 - 171..172 'x': u32 - 242..246 'self': &S2 - 248..249 'x': i32 - 265..279 '{ let y = x; }': () - 271..272 'y': i32 - 275..276 'x': i32 + 40..44 'self': &Self + 46..47 'x': Trait::Item + 126..130 'self': &S + 132..133 'x': u32 + 147..161 '{ let y = x; }': () + 153..154 'y': u32 + 157..158 'x': u32 + 228..232 'self': &S2 + 234..235 'x': i32 + 251..265 '{ let y = x; }': () + 257..258 'y': i32 + 261..262 'x': i32 "###); } @@ -2331,15 +2331,15 @@ impl TokenStream for Rustc { } "#), @r###" - 1062..1073 '{ loop {} }': T - 1064..1071 'loop {}': ! - 1069..1071 '{}': () - 1137..1200 '{ ... }': T - 1151..1156 'group': G - 1172..1176 'make': fn make() -> G - 1172..1178 'make()': G - 1188..1192 'make': fn make() -> T - 1188..1194 'make()': T + 1061..1072 '{ loop {} }': T + 1063..1070 'loop {}': ! + 1068..1070 '{}': () + 1136..1199 '{ ... }': T + 1150..1155 'group': G + 1171..1175 'make': fn make() -> G + 1171..1177 'make()': G + 1187..1191 'make': fn make() -> T + 1187..1193 'make()': T "### ); } @@ -2366,37 +2366,37 @@ fn test() -> impl Trait { } "#, true), @r###" - 27..28 'x': impl Trait - 47..58 '{ loop {} }': () - 49..56 'loop {}': ! - 54..56 '{}': () - 69..70 'x': impl Trait - 92..103 '{ loop {} }': T - 94..101 'loop {}': ! - 99..101 '{}': () - 172..183 '{ loop {} }': T - 174..181 'loop {}': ! - 179..181 '{}': () - 214..310 '{ ...t()) }': S<{unknown}> - 224..226 's1': S - 229..230 'S': S(u32) -> S - 229..241 'S(default())': S - 231..238 'default': fn default() -> u32 - 231..240 'default()': u32 - 247..250 'foo': fn foo(S) - 247..254 'foo(s1)': () - 251..253 's1': S - 264..265 'x': i32 - 273..276 'bar': fn bar(S) -> i32 - 273..290 'bar(S(...lt()))': i32 - 277..278 'S': S(i32) -> S - 277..289 'S(default())': S - 279..286 'default': fn default() -> i32 - 279..288 'default()': i32 - 296..297 'S': S<{unknown}>({unknown}) -> S<{unknown}> - 296..308 'S(default())': S<{unknown}> - 298..305 'default': fn default<{unknown}>() -> {unknown} - 298..307 'default()': {unknown} + 26..27 'x': impl Trait + 46..57 '{ loop {} }': () + 48..55 'loop {}': ! + 53..55 '{}': () + 68..69 'x': impl Trait + 91..102 '{ loop {} }': T + 93..100 'loop {}': ! + 98..100 '{}': () + 171..182 '{ loop {} }': T + 173..180 'loop {}': ! + 178..180 '{}': () + 213..309 '{ ...t()) }': S<{unknown}> + 223..225 's1': S + 228..229 'S': S(u32) -> S + 228..240 'S(default())': S + 230..237 'default': fn default() -> u32 + 230..239 'default()': u32 + 246..249 'foo': fn foo(S) + 246..253 'foo(s1)': () + 250..252 's1': S + 263..264 'x': i32 + 272..275 'bar': fn bar(S) -> i32 + 272..289 'bar(S(...lt()))': i32 + 276..277 'S': S(i32) -> S + 276..288 'S(default())': S + 278..285 'default': fn default() -> i32 + 278..287 'default()': i32 + 295..296 'S': S<{unknown}>({unknown}) -> S<{unknown}> + 295..307 'S(default())': S<{unknown}> + 297..304 'default': fn default<{unknown}>() -> {unknown} + 297..306 'default()': {unknown} "### ); } @@ -2430,15 +2430,15 @@ fn main() { } "#), @r###" - 147..149 '_v': F - 192..195 '{ }': () - 207..238 '{ ... }); }': () - 213..223 'f::<(), _>': fn f<(), |&()| -> ()>(|&()| -> ()) - 213..235 'f::<()... z; })': () - 224..234 '|z| { z; }': |&()| -> () - 225..226 'z': &() - 228..234 '{ z; }': () - 230..231 'z': &() + 133..135 '_v': F + 178..181 '{ }': () + 193..224 '{ ... }); }': () + 199..209 'f::<(), _>': fn f<(), |&()| -> ()>(|&()| -> ()) + 199..221 'f::<()... z; })': () + 210..220 '|z| { z; }': |&()| -> () + 211..212 'z': &() + 214..220 '{ z; }': () + 216..217 'z': &() "### ); } @@ -2591,46 +2591,46 @@ fn main() { } "#), @r###" - 240..244 'self': Self - 246..247 'f': F - 331..342 '{ loop {} }': FilterMap - 333..340 'loop {}': ! - 338..340 '{}': () - 363..367 'self': Self - 369..370 'f': F - 419..430 '{ loop {} }': () - 421..428 'loop {}': ! - 426..428 '{}': () - 539..543 'self': Self - 868..872 'self': I - 879..899 '{ ... }': I - 889..893 'self': I - 958..969 '{ loop {} }': Vec - 960..967 'loop {}': ! - 965..967 '{}': () - 1156..1287 '{ ... }); }': () - 1162..1177 'Vec::::new': fn new() -> Vec - 1162..1179 'Vec::<...:new()': Vec - 1162..1191 'Vec::<...iter()': IntoIter - 1162..1256 'Vec::<...one })': FilterMap, |i32| -> Option> - 1162..1284 'Vec::<... y; })': () - 1210..1255 '|x| if...None }': |i32| -> Option - 1211..1212 'x': i32 - 1214..1255 'if x >...None }': Option - 1217..1218 'x': i32 - 1217..1222 'x > 0': bool - 1221..1222 '0': i32 - 1223..1241 '{ Some...u32) }': Option - 1225..1229 'Some': Some(u32) -> Option - 1225..1239 'Some(x as u32)': Option - 1230..1231 'x': i32 - 1230..1238 'x as u32': u32 - 1247..1255 '{ None }': Option - 1249..1253 'None': Option - 1273..1283 '|y| { y; }': |u32| -> () - 1274..1275 'y': u32 - 1277..1283 '{ y; }': () - 1279..1280 'y': u32 + 226..230 'self': Self + 232..233 'f': F + 317..328 '{ loop {} }': FilterMap + 319..326 'loop {}': ! + 324..326 '{}': () + 349..353 'self': Self + 355..356 'f': F + 405..416 '{ loop {} }': () + 407..414 'loop {}': ! + 412..414 '{}': () + 525..529 'self': Self + 854..858 'self': I + 865..885 '{ ... }': I + 875..879 'self': I + 944..955 '{ loop {} }': Vec + 946..953 'loop {}': ! + 951..953 '{}': () + 1142..1273 '{ ... }); }': () + 1148..1163 'Vec::::new': fn new() -> Vec + 1148..1165 'Vec::<...:new()': Vec + 1148..1177 'Vec::<...iter()': IntoIter + 1148..1242 'Vec::<...one })': FilterMap, |i32| -> Option> + 1148..1270 'Vec::<... y; })': () + 1196..1241 '|x| if...None }': |i32| -> Option + 1197..1198 'x': i32 + 1200..1241 'if x >...None }': Option + 1203..1204 'x': i32 + 1203..1208 'x > 0': bool + 1207..1208 '0': i32 + 1209..1227 '{ Some...u32) }': Option + 1211..1215 'Some': Some(u32) -> Option + 1211..1225 'Some(x as u32)': Option + 1216..1217 'x': i32 + 1216..1224 'x as u32': u32 + 1233..1241 '{ None }': Option + 1235..1239 'None': Option + 1259..1269 '|y| { y; }': |u32| -> () + 1260..1261 'y': u32 + 1263..1269 '{ y; }': () + 1265..1266 'y': u32 "### ); } @@ -2682,13 +2682,13 @@ fn test(x: &dyn Foo) { } "#, true), @r###" - 22..23 'x': &dyn Foo - 35..37 '{}': () - 47..48 'x': &dyn Foo - 60..75 '{ foo(x); }': () - 66..69 'foo': fn foo(&dyn Foo) - 66..72 'foo(x)': () - 70..71 'x': &dyn Foo + 21..22 'x': &dyn Foo + 34..36 '{}': () + 46..47 'x': &dyn Foo + 59..74 '{ foo(x); }': () + 65..68 'foo': fn foo(&dyn Foo) + 65..71 'foo(x)': () + 69..70 'x': &dyn Foo "### ); } @@ -2715,20 +2715,20 @@ fn test() { } "#, true), @r###" - 111..115 'self': &Self - 167..268 '{ ...t(); }': () - 173..179 'IsCopy': IsCopy - 173..186 'IsCopy.test()': bool - 192..199 'NotCopy': NotCopy - 192..206 'NotCopy.test()': {unknown} - 212..228 '(IsCop...sCopy)': (IsCopy, IsCopy) - 212..235 '(IsCop...test()': bool - 213..219 'IsCopy': IsCopy - 221..227 'IsCopy': IsCopy - 241..258 '(IsCop...tCopy)': (IsCopy, NotCopy) - 241..265 '(IsCop...test()': {unknown} - 242..248 'IsCopy': IsCopy - 250..257 'NotCopy': NotCopy + 110..114 'self': &Self + 166..267 '{ ...t(); }': () + 172..178 'IsCopy': IsCopy + 172..185 'IsCopy.test()': bool + 191..198 'NotCopy': NotCopy + 191..205 'NotCopy.test()': {unknown} + 211..227 '(IsCop...sCopy)': (IsCopy, IsCopy) + 211..234 '(IsCop...test()': bool + 212..218 'IsCopy': IsCopy + 220..226 'IsCopy': IsCopy + 240..257 '(IsCop...tCopy)': (IsCopy, NotCopy) + 240..264 '(IsCop...test()': {unknown} + 241..247 'IsCopy': IsCopy + 249..256 'NotCopy': NotCopy "### ); } @@ -2756,20 +2756,20 @@ fn test() { } "#, true), @r###" - 42..44 '{}': () - 61..62 'T': {unknown} - 69..71 '{}': () - 69..71: expected T, got () - 146..150 'self': &Self - 202..282 '{ ...t(); }': () - 208..211 'foo': fn foo() - 208..218 'foo.test()': bool - 224..227 'bar': fn bar<{unknown}>({unknown}) -> {unknown} - 224..234 'bar.test()': bool - 240..246 'Struct': Struct(usize) -> Struct - 240..253 'Struct.test()': bool - 259..272 'Enum::Variant': Variant(usize) -> Enum - 259..279 'Enum::...test()': bool + 41..43 '{}': () + 60..61 'T': {unknown} + 68..70 '{}': () + 68..70: expected T, got () + 145..149 'self': &Self + 201..281 '{ ...t(); }': () + 207..210 'foo': fn foo() + 207..217 'foo.test()': bool + 223..226 'bar': fn bar<{unknown}>({unknown}) -> {unknown} + 223..233 'bar.test()': bool + 239..245 'Struct': Struct(usize) -> Struct + 239..252 'Struct.test()': bool + 258..271 'Enum::Variant': Variant(usize) -> Enum + 258..278 'Enum::...test()': bool "### ); } @@ -2791,17 +2791,17 @@ fn test(f1: fn(), f2: fn(usize) -> u8, f3: fn(u8, u8) -> &u8) { } "#, true), @r###" - 55..59 'self': &Self - 109..111 'f1': fn() - 119..121 'f2': fn(usize) -> u8 - 140..142 'f3': fn(u8, u8) -> &u8 - 163..211 '{ ...t(); }': () - 169..171 'f1': fn() - 169..178 'f1.test()': bool - 184..186 'f2': fn(usize) -> u8 - 184..193 'f2.test()': bool - 199..201 'f3': fn(u8, u8) -> &u8 - 199..208 'f3.test()': bool + 54..58 'self': &Self + 108..110 'f1': fn() + 118..120 'f2': fn(usize) -> u8 + 139..141 'f3': fn(u8, u8) -> &u8 + 162..210 '{ ...t(); }': () + 168..170 'f1': fn() + 168..177 'f1.test()': bool + 183..185 'f2': fn(usize) -> u8 + 183..192 'f2.test()': bool + 198..200 'f3': fn(u8, u8) -> &u8 + 198..207 'f3.test()': bool "### ); } @@ -2824,22 +2824,22 @@ fn test() { } "#, true), @r###" - 57..61 'self': &Self - 114..229 '{ ...ized }': () - 120..123 '1u8': u8 - 120..130 '1u8.test()': bool - 136..151 '(*"foo").test()': {unknown} - 137..143 '*"foo"': str - 138..143 '"foo"': &str - 170..180 '(1u8, 1u8)': (u8, u8) - 170..187 '(1u8, ...test()': bool - 171..174 '1u8': u8 - 176..179 '1u8': u8 - 193..206 '(1u8, *"foo")': (u8, str) - 193..213 '(1u8, ...test()': {unknown} - 194..197 '1u8': u8 - 199..205 '*"foo"': str - 200..205 '"foo"': &str + 56..60 'self': &Self + 113..228 '{ ...ized }': () + 119..122 '1u8': u8 + 119..129 '1u8.test()': bool + 135..150 '(*"foo").test()': {unknown} + 136..142 '*"foo"': str + 137..142 '"foo"': &str + 169..179 '(1u8, 1u8)': (u8, u8) + 169..186 '(1u8, ...test()': bool + 170..173 '1u8': u8 + 175..178 '1u8': u8 + 192..205 '(1u8, *"foo")': (u8, str) + 192..212 '(1u8, ...test()': {unknown} + 193..196 '1u8': u8 + 198..204 '*"foo"': str + 199..204 '"foo"': &str "### ); } @@ -2909,17 +2909,17 @@ fn infer_closure_arg() { "# ), @r###" - 137..259 '{ ... }': () - 159..160 's': Option - 163..175 'Option::None': Option - 197..198 'f': |Option| -> () - 201..220 '|x: Op...2>| {}': |Option| -> () - 202..203 'x': Option - 218..220 '{}': () - 238..245 '(&f)(s)': () - 239..241 '&f': &|Option| -> () - 240..241 'f': |Option| -> () - 243..244 's': Option + 52..126 '{ ...)(s) }': () + 62..63 's': Option + 66..78 'Option::None': Option + 88..89 'f': |Option| -> () + 92..111 '|x: Op...2>| {}': |Option| -> () + 93..94 'x': Option + 109..111 '{}': () + 117..124 '(&f)(s)': () + 118..120 '&f': &|Option| -> () + 119..120 'f': |Option| -> () + 122..123 's': Option "### ); } @@ -2958,17 +2958,17 @@ fn infer_fn_trait_arg() { "# ), @r###" - 183..187 'self': &Self - 189..193 'args': Args - 350..354 'self': &Self - 356..360 'args': Args - 515..516 'f': F - 597..663 '{ ... }': T - 619..620 's': Option - 623..627 'None': Option - 645..646 'f': F - 645..649 'f(s)': T - 647..648 's': Option + 101..105 'self': &Self + 107..111 'args': Args + 220..224 'self': &Self + 226..230 'args': Args + 313..314 'f': F + 359..389 '{ ...f(s) }': T + 369..370 's': Option + 373..377 'None': Option + 383..384 'f': F + 383..387 'f(s)': T + 385..386 's': Option "### ); } @@ -3020,26 +3020,26 @@ fn infer_box_fn_arg() { "# ), @r###" - 182..186 'self': Self - 188..192 'args': Args - 356..360 'self': &Self - 622..626 'self': &Box - 634..685 '{ ... }': &T - 656..667 '&self.inner': &*mut T - 657..661 'self': &Box - 657..667 'self.inner': *mut T - 812..957 '{ ... }': FnOnce::Output,)>, (&Option,)> - 834..835 's': Option - 838..850 'Option::None': Option - 872..873 'f': Box,)>> - 907..920 'box (|ps| {})': Box<|{unknown}| -> ()> - 912..919 '|ps| {}': |{unknown}| -> () - 913..915 'ps': {unknown} - 917..919 '{}': () - 938..939 'f': Box,)>> - 938..943 'f(&s)': FnOnce::Output,)>, (&Option,)> - 940..942 '&s': &Option - 941..942 's': Option + 100..104 'self': Self + 106..110 'args': Args + 214..218 'self': &Self + 384..388 'self': &Box + 396..423 '{ ... }': &T + 406..417 '&self.inner': &*mut T + 407..411 'self': &Box + 407..417 'self.inner': *mut T + 478..575 '{ ...(&s) }': FnOnce::Output,)>, (&Option,)> + 488..489 's': Option + 492..504 'Option::None': Option + 514..515 'f': Box,)>> + 549..562 'box (|ps| {})': Box<|{unknown}| -> ()> + 554..561 '|ps| {}': |{unknown}| -> () + 555..557 'ps': {unknown} + 559..561 '{}': () + 568..569 'f': Box,)>> + 568..573 'f(&s)': FnOnce::Output,)>, (&Option,)> + 570..572 '&s': &Option + 571..572 's': Option "### ); } @@ -3090,24 +3090,24 @@ fn infer_dyn_fn_output() { "# ), @r###" - 182..186 'self': Self - 188..192 'args': Args - 349..353 'self': &Self - 355..359 'args': Args - 523..527 'self': &Self - 789..793 'self': &Box - 801..852 '{ ... }': &T - 823..834 '&self.inner': &*mut T - 824..828 'self': &Box - 824..834 'self.inner': *mut T - 889..990 '{ ... }': () - 911..912 'f': Box> - 937..946 'box(|| 5)': Box<|| -> i32> - 941..945 '|| 5': || -> i32 - 944..945 '5': i32 - 968..969 'x': FnOnce::Output, ()> - 972..973 'f': Box> - 972..975 'f()': FnOnce::Output, ()> + 100..104 'self': Self + 106..110 'args': Args + 219..223 'self': &Self + 225..229 'args': Args + 333..337 'self': &Self + 503..507 'self': &Box + 515..542 '{ ... }': &T + 525..536 '&self.inner': &*mut T + 526..530 'self': &Box + 526..536 'self.inner': *mut T + 555..620 '{ ...f(); }': () + 565..566 'f': Box> + 591..600 'box(|| 5)': Box<|| -> i32> + 595..599 '|| 5': || -> i32 + 598..599 '5': i32 + 610..611 'x': FnOnce::Output, ()> + 614..615 'f': Box> + 614..617 'f()': FnOnce::Output, ()> "### ); }