mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Use only one code-path for parsing fixtures
This removes leading newlines everywhere, shifting all ranges in tests by one
This commit is contained in:
parent
e5101ae150
commit
d016cb4867
11 changed files with 2751 additions and 2790 deletions
|
@ -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() };
|
||||
|
||||
|
|
|
@ -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<DB: SourceDatabaseExt + Default + 'static> 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,
|
||||
|
|
|
@ -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::<ast::Name>(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,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<U>() -> *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]) -> 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<u8>(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<U>() -> *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]) -> 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<u8>(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<u8>(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<u8>(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<u8>(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<u8>(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]) -> &[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]) -> &[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]) -> &[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]) -> &[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]) -> &[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]) -> &[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]) -> &[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]) -> &[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) -> 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) -> 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<TT> S<TT> {
|
|||
}
|
||||
"#, true),
|
||||
@r###"
|
||||
51..55 'self': &S<TT>
|
||||
64..87 '{ ... }': &TT
|
||||
74..81 '&self.t': &TT
|
||||
75..79 'self': &S<TT>
|
||||
75..81 'self.t': TT
|
||||
50..54 'self': &S<TT>
|
||||
63..86 '{ ... }': &TT
|
||||
73..80 '&self.t': &TT
|
||||
74..78 'self': &S<TT>
|
||||
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<i8, i16>
|
||||
423..425 '&S': &S<i8, i16>
|
||||
424..425 'S': S<i8, i16>
|
||||
435..438 'obj': &dyn Bar<usize, i8, i16>
|
||||
460..463 'obj': &dyn Baz<i8, i16>
|
||||
473..476 'obj': &dyn Foo<i8, usize>
|
||||
495..498 'obj': &dyn Bar<usize, i8, i16>
|
||||
508..512 'obj2': &dyn Baz<i8, i16>
|
||||
534..536 '&S': &S<i8, i16>
|
||||
535..536 'S': S<i8, i16>
|
||||
546..547 '_': &dyn Foo<i8, usize>
|
||||
566..570 'obj2': &dyn Baz<i8, i16>
|
||||
387..572 '{ ...bj2; }': ()
|
||||
397..400 'obj': &dyn Baz<i8, i16>
|
||||
422..424 '&S': &S<i8, i16>
|
||||
423..424 'S': S<i8, i16>
|
||||
434..437 'obj': &dyn Bar<usize, i8, i16>
|
||||
459..462 'obj': &dyn Baz<i8, i16>
|
||||
472..475 'obj': &dyn Foo<i8, usize>
|
||||
494..497 'obj': &dyn Bar<usize, i8, i16>
|
||||
507..511 'obj2': &dyn Baz<i8, i16>
|
||||
533..535 '&S': &S<i8, i16>
|
||||
534..535 'S': S<i8, i16>
|
||||
545..546 '_': &dyn Foo<i8, usize>
|
||||
565..569 'obj2': &dyn Baz<i8, i16>
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -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
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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]) -> 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]) -> 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<T>
|
||||
92..103 'Gen { val }': Gen<T>
|
||||
98..101 'val': T
|
||||
123..155 '{ ...32); }': ()
|
||||
133..134 'a': Gen<u32>
|
||||
137..146 'Gen::make': fn make<u32>(u32) -> Gen<u32>
|
||||
137..152 'Gen::make(0u32)': Gen<u32>
|
||||
147..151 '0u32': u32
|
||||
63..66 'val': T
|
||||
81..108 '{ ... }': Gen<T>
|
||||
91..102 'Gen { val }': Gen<T>
|
||||
97..100 'val': T
|
||||
122..154 '{ ...32); }': ()
|
||||
132..133 'a': Gen<u32>
|
||||
136..145 'Gen::make': fn make<u32>(u32) -> Gen<u32>
|
||||
136..151 'Gen::make(0u32)': Gen<u32>
|
||||
146..150 '0u32': u32
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -202,13 +202,13 @@ fn test() {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
76..100 '{ ... }': Gen<T>
|
||||
86..94 'loop { }': !
|
||||
91..94 '{ }': ()
|
||||
114..149 '{ ...e(); }': ()
|
||||
124..125 'a': Gen<u32>
|
||||
128..144 'Gen::<...::make': fn make<u32>() -> Gen<u32>
|
||||
128..146 'Gen::<...make()': Gen<u32>
|
||||
75..99 '{ ... }': Gen<T>
|
||||
85..93 'loop { }': !
|
||||
90..93 '{ }': ()
|
||||
113..148 '{ ...e(); }': ()
|
||||
123..124 'a': Gen<u32>
|
||||
127..143 'Gen::<...::make': fn make<u32>() -> Gen<u32>
|
||||
127..145 'Gen::<...make()': Gen<u32>
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -233,13 +233,13 @@ fn test() {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
102..126 '{ ... }': Gen<u32, T>
|
||||
112..120 'loop { }': !
|
||||
117..120 '{ }': ()
|
||||
140..180 '{ ...e(); }': ()
|
||||
150..151 'a': Gen<u32, u64>
|
||||
154..175 'Gen::<...::make': fn make<u64>() -> Gen<u32, u64>
|
||||
154..177 'Gen::<...make()': Gen<u32, u64>
|
||||
101..125 '{ ... }': Gen<u32, T>
|
||||
111..119 'loop { }': !
|
||||
116..119 '{ }': ()
|
||||
139..179 '{ ...e(); }': ()
|
||||
149..150 'a': Gen<u32, u64>
|
||||
153..174 'Gen::<...::make': fn make<u64>() -> Gen<u32, u64>
|
||||
153..176 'Gen::<...make()': Gen<u32, u64>
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -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>(u32) -> S<u32>
|
||||
108..115 'S(1u32)': S<u32>
|
||||
108..124 'S(1u32...thod()': u32
|
||||
110..114 '1u32': u32
|
||||
32..36 'self': &Self
|
||||
101..126 '{ ...d(); }': ()
|
||||
107..108 'S': S<u32>(u32) -> S<u32>
|
||||
107..114 'S(1u32)': S<u32>
|
||||
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>() -> S
|
||||
105..123 'Defaul...ault()': S
|
||||
133..135 's2': S
|
||||
138..148 'S::default': fn default<S>() -> S
|
||||
138..150 'S::default()': S
|
||||
160..162 's3': S
|
||||
165..188 '<S as ...efault': fn default<S>() -> S
|
||||
165..190 '<S as ...ault()': S
|
||||
86..192 '{ ...t(); }': ()
|
||||
96..98 's1': S
|
||||
104..120 'Defaul...efault': fn default<S>() -> S
|
||||
104..122 'Defaul...ault()': S
|
||||
132..134 's2': S
|
||||
137..147 'S::default': fn default<S>() -> S
|
||||
137..149 'S::default()': S
|
||||
159..161 's3': S
|
||||
164..187 '<S as ...efault': fn default<S>() -> S
|
||||
164..189 '<S as ...ault()': S
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -478,16 +478,16 @@ fn test() {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
127..211 '{ ...e(); }': ()
|
||||
137..138 'a': u32
|
||||
141..148 'S::make': fn make<S, u32>() -> u32
|
||||
141..150 'S::make()': u32
|
||||
160..161 'b': u64
|
||||
164..178 'G::<u64>::make': fn make<G<u64>, u64>() -> u64
|
||||
164..180 'G::<u6...make()': u64
|
||||
190..191 'c': f64
|
||||
199..206 'G::make': fn make<G<f64>, f64>() -> f64
|
||||
199..208 'G::make()': f64
|
||||
126..210 '{ ...e(); }': ()
|
||||
136..137 'a': u32
|
||||
140..147 'S::make': fn make<S, u32>() -> u32
|
||||
140..149 'S::make()': u32
|
||||
159..160 'b': u64
|
||||
163..177 'G::<u64>::make': fn make<G<u64>, u64>() -> u64
|
||||
163..179 'G::<u6...make()': u64
|
||||
189..190 'c': f64
|
||||
198..205 'G::make': fn make<G<f64>, 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::<i64>': fn make<S, u32, i64>() -> (u32, i64)
|
||||
149..165 'S::mak...i64>()': (u32, i64)
|
||||
175..176 'b': (u32, i64)
|
||||
189..196 'S::make': fn make<S, u32, i64>() -> (u32, i64)
|
||||
189..198 'S::make()': (u32, i64)
|
||||
208..209 'c': (u32, i64)
|
||||
212..233 'G::<u3...:<i64>': fn make<G<u32>, u32, i64>() -> (u32, i64)
|
||||
212..235 'G::<u3...i64>()': (u32, i64)
|
||||
245..246 'd': (u32, i64)
|
||||
259..273 'G::make::<i64>': fn make<G<u32>, u32, i64>() -> (u32, i64)
|
||||
259..275 'G::mak...i64>()': (u32, i64)
|
||||
285..286 'e': (u32, i64)
|
||||
301..308 'G::make': fn make<G<u32>, u32, i64>() -> (u32, i64)
|
||||
301..310 'G::make()': (u32, i64)
|
||||
134..312 '{ ...e(); }': ()
|
||||
144..145 'a': (u32, i64)
|
||||
148..162 'S::make::<i64>': fn make<S, u32, i64>() -> (u32, i64)
|
||||
148..164 'S::mak...i64>()': (u32, i64)
|
||||
174..175 'b': (u32, i64)
|
||||
188..195 'S::make': fn make<S, u32, i64>() -> (u32, i64)
|
||||
188..197 'S::make()': (u32, i64)
|
||||
207..208 'c': (u32, i64)
|
||||
211..232 'G::<u3...:<i64>': fn make<G<u32>, u32, i64>() -> (u32, i64)
|
||||
211..234 'G::<u3...i64>()': (u32, i64)
|
||||
244..245 'd': (u32, i64)
|
||||
258..272 'G::make::<i64>': fn make<G<u32>, u32, i64>() -> (u32, i64)
|
||||
258..274 'G::mak...i64>()': (u32, i64)
|
||||
284..285 'e': (u32, i64)
|
||||
300..307 'G::make': fn make<G<u32>, u32, i64>() -> (u32, i64)
|
||||
300..309 'G::make()': (u32, i64)
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -546,10 +546,10 @@ fn test() {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
101..127 '{ ...e(); }': ()
|
||||
111..112 'a': (S<i32>, i64)
|
||||
115..122 'S::make': fn make<S<i32>, i64>() -> (S<i32>, i64)
|
||||
115..124 'S::make()': (S<i32>, i64)
|
||||
100..126 '{ ...e(); }': ()
|
||||
110..111 'a': (S<i32>, i64)
|
||||
114..121 'S::make': fn make<S<i32>, i64>() -> (S<i32>, i64)
|
||||
114..123 'S::make()': (S<i32>, i64)
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -570,13 +570,13 @@ fn test() {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
131..203 '{ ...e(); }': ()
|
||||
141..142 'a': (S<u64>, i64)
|
||||
158..165 'S::make': fn make<S<u64>, i64>() -> (S<u64>, i64)
|
||||
158..167 'S::make()': (S<u64>, i64)
|
||||
177..178 'b': (S<u32>, i32)
|
||||
191..198 'S::make': fn make<S<u32>, i32>() -> (S<u32>, i32)
|
||||
191..200 'S::make()': (S<u32>, i32)
|
||||
130..202 '{ ...e(); }': ()
|
||||
140..141 'a': (S<u64>, i64)
|
||||
157..164 'S::make': fn make<S<u64>, i64>() -> (S<u64>, i64)
|
||||
157..166 'S::make()': (S<u64>, i64)
|
||||
176..177 'b': (S<u32>, i32)
|
||||
190..197 'S::make': fn make<S<u32>, i32>() -> (S<u32>, i32)
|
||||
190..199 'S::make()': (S<u32>, i32)
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -596,13 +596,13 @@ fn test() {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
107..211 '{ ...>(); }': ()
|
||||
117..118 'a': (S<u64>, i64, u8)
|
||||
121..150 '<S as ...::<u8>': fn make<S<u64>, i64, u8>() -> (S<u64>, i64, u8)
|
||||
121..152 '<S as ...<u8>()': (S<u64>, i64, u8)
|
||||
162..163 'b': (S<u64>, i64, u8)
|
||||
182..206 'Trait:...::<u8>': fn make<S<u64>, i64, u8>() -> (S<u64>, i64, u8)
|
||||
182..208 'Trait:...<u8>()': (S<u64>, i64, u8)
|
||||
106..210 '{ ...>(); }': ()
|
||||
116..117 'a': (S<u64>, i64, u8)
|
||||
120..149 '<S as ...::<u8>': fn make<S<u64>, i64, u8>() -> (S<u64>, i64, u8)
|
||||
120..151 '<S as ...<u8>()': (S<u64>, i64, u8)
|
||||
161..162 'b': (S<u64>, i64, u8)
|
||||
181..205 'Trait:...::<u8>': fn make<S<u64>, i64, u8>() -> (S<u64>, i64, u8)
|
||||
181..207 'Trait:...<u8>()': (S<u64>, i64, u8)
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -619,11 +619,11 @@ fn test<T: Trait>(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<U, T: Trait<U>>(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>(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>(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
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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 ()
|
||||
"###);
|
||||
}
|
||||
|
|
|
@ -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>() -> 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>() -> 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>() -> 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>() -> 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>() -> 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>() -> 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>() -> 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>() -> 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>() -> 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>() -> 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<i32>
|
||||
40..41 'n': &i32
|
||||
45..50 '&A(1)': &A<i32>
|
||||
46..47 'A': A<i32>(i32) -> A<i32>
|
||||
46..50 'A(1)': A<i32>
|
||||
48..49 '1': i32
|
||||
60..64 'A(n)': A<i32>
|
||||
62..63 'n': &mut i32
|
||||
67..76 '&mut A(1)': &mut A<i32>
|
||||
72..73 'A': A<i32>(i32) -> A<i32>
|
||||
72..76 'A(1)': A<i32>
|
||||
74..75 '1': i32
|
||||
27..78 '{ ...(1); }': ()
|
||||
37..41 'A(n)': A<i32>
|
||||
39..40 'n': &i32
|
||||
44..49 '&A(1)': &A<i32>
|
||||
45..46 'A': A<i32>(i32) -> A<i32>
|
||||
45..49 'A(1)': A<i32>
|
||||
47..48 '1': i32
|
||||
59..63 'A(n)': A<i32>
|
||||
61..62 'n': &mut i32
|
||||
66..75 '&mut A(1)': &mut A<i32>
|
||||
71..72 'A': A<i32>(i32) -> A<i32>
|
||||
71..75 'A(1)': A<i32>
|
||||
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<u32>, o: Option<u64>) {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
79..81 'a1': A<u32>
|
||||
91..92 'o': Option<u64>
|
||||
107..244 '{ ... }; }': ()
|
||||
117..128 'A { x: x2 }': A<u32>
|
||||
124..126 'x2': u32
|
||||
131..133 'a1': A<u32>
|
||||
143..161 'A::<i6...: x3 }': A<i64>
|
||||
157..159 'x3': i64
|
||||
164..174 'A { x: 1 }': A<i64>
|
||||
171..172 '1': i64
|
||||
180..241 'match ... }': u64
|
||||
186..187 'o': Option<u64>
|
||||
198..213 'Option::Some(t)': Option<u64>
|
||||
211..212 't': u64
|
||||
217..218 't': u64
|
||||
228..229 '_': Option<u64>
|
||||
233..234 '1': u64
|
||||
78..80 'a1': A<u32>
|
||||
90..91 'o': Option<u64>
|
||||
106..243 '{ ... }; }': ()
|
||||
116..127 'A { x: x2 }': A<u32>
|
||||
123..125 'x2': u32
|
||||
130..132 'a1': A<u32>
|
||||
142..160 'A::<i6...: x3 }': A<i64>
|
||||
156..158 'x3': i64
|
||||
163..173 'A { x: 1 }': A<i64>
|
||||
170..171 '1': i64
|
||||
179..240 'match ... }': u64
|
||||
185..186 'o': Option<u64>
|
||||
197..212 'Option::Some(t)': Option<u64>
|
||||
210..211 't': u64
|
||||
216..217 't': u64
|
||||
227..228 '_': Option<u64>
|
||||
232..233 '1': u64
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -470,27 +470,27 @@ fn test() {
|
|||
}
|
||||
"#, true),
|
||||
@r###"
|
||||
74..75 '1': usize
|
||||
88..310 '{ ...atch }': ()
|
||||
98..99 'a': Option<u32>
|
||||
115..119 'None': Option<u32>
|
||||
129..130 'b': Option<i64>
|
||||
146..183 'match ... }': Option<i64>
|
||||
152..153 'a': Option<u32>
|
||||
164..168 'None': Option<u32>
|
||||
172..176 'None': Option<i64>
|
||||
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<u32>
|
||||
114..118 'None': Option<u32>
|
||||
128..129 'b': Option<i64>
|
||||
145..182 'match ... }': Option<i64>
|
||||
151..152 'a': Option<u32>
|
||||
163..167 'None': Option<u32>
|
||||
171..175 'None': Option<i64>
|
||||
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
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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<R>(query_response: Canonical<QueryResponse<R>>) {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
92..106 'query_response': Canonical<QueryResponse<R>>
|
||||
137..167 '{ ...lue; }': ()
|
||||
143..164 '&query....value': &QueryResponse<R>
|
||||
144..158 'query_response': Canonical<QueryResponse<R>>
|
||||
144..164 'query_....value': QueryResponse<R>
|
||||
91..105 'query_response': Canonical<QueryResponse<R>>
|
||||
136..166 '{ ...lue; }': ()
|
||||
142..163 '&query....value': &QueryResponse<R>
|
||||
143..157 'query_response': Canonical<QueryResponse<R>>
|
||||
143..163 'query_....value': QueryResponse<R>
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -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 '<Trait...>::foo': {unknown}
|
||||
32..51 '<Trait...:foo()': ()
|
||||
25..52 '{ ...oo() }': ()
|
||||
31..48 '<Trait...>::foo': {unknown}
|
||||
31..50 '<Trait...:foo()': ()
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -495,13 +495,13 @@ fn foo(params: &[usize]) {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
8..14 'params': &[usize]
|
||||
26..81 '{ ... } }': ()
|
||||
32..79 'match ... }': ()
|
||||
38..44 'params': &[usize]
|
||||
55..67 '[ps @ .., _]': [usize]
|
||||
65..66 '_': usize
|
||||
71..73 '{}': ()
|
||||
7..13 'params': &[usize]
|
||||
25..80 '{ ... } }': ()
|
||||
31..78 'match ... }': ()
|
||||
37..43 'params': &[usize]
|
||||
54..66 '[ps @ .., _]': [usize]
|
||||
64..65 '_': usize
|
||||
70..72 '{}': ()
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -522,13 +522,13 @@ fn foo(b: Bar) {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
36..37 'b': Bar
|
||||
44..96 '{ ... } }': ()
|
||||
50..94 'match ... }': ()
|
||||
56..57 'b': Bar
|
||||
68..81 'Bar { a: .. }': Bar
|
||||
77..79 '..': bool
|
||||
85..87 '{}': ()
|
||||
35..36 'b': Bar
|
||||
43..95 '{ ... } }': ()
|
||||
49..93 'match ... }': ()
|
||||
55..56 'b': Bar
|
||||
67..80 'Bar { a: .. }': Bar
|
||||
76..78 '..': bool
|
||||
84..86 '{}': ()
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -549,16 +549,16 @@ fn main() {
|
|||
a.foo();
|
||||
}
|
||||
"#), @r###"
|
||||
32..38 'FOO {}': FOO
|
||||
64..68 'self': &FOO
|
||||
70..72 '{}': ()
|
||||
86..120 '{ ...o(); }': ()
|
||||
96..97 'a': &FOO
|
||||
100..104 '&FOO': &FOO
|
||||
101..104 'FOO': FOO
|
||||
110..111 'a': &FOO
|
||||
110..117 'a.foo()': ()
|
||||
"###
|
||||
31..37 'FOO {}': FOO
|
||||
63..67 'self': &FOO
|
||||
69..71 '{}': ()
|
||||
85..119 '{ ...o(); }': ()
|
||||
95..96 'a': &FOO
|
||||
99..103 '&FOO': &FOO
|
||||
100..103 'FOO': FOO
|
||||
109..110 'a': &FOO
|
||||
109..116 'a.foo()': ()
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -580,17 +580,17 @@ fn main() {
|
|||
let _a = foo!();
|
||||
}
|
||||
"#), @r###"
|
||||
45..60 '{ loop {} }': T
|
||||
51..58 'loop {}': !
|
||||
56..58 '{}': ()
|
||||
44..59 '{ loop {} }': T
|
||||
50..57 'loop {}': !
|
||||
55..57 '{}': ()
|
||||
!0..31 '{letr:...g();r}': Foo
|
||||
!4..5 'r': Foo
|
||||
!18..26 'anything': fn anything<Foo>() -> 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<F, S, D, W, O, LOf, {unknown}, {unknown}>
|
||||
489..523 '{ ... }': ()
|
||||
499..503 'self': SelectStatement<F, S, D, W, O, LOf, {unknown}, {unknown}>
|
||||
499..509 'self.order': O
|
||||
499..516 'self.o...into()': dyn QueryFragment<DB>
|
||||
65..69 'self': Self
|
||||
267..271 'self': Self
|
||||
466..470 'self': SelectStatement<F, S, D, W, O, LOf, {unknown}, {unknown}>
|
||||
488..522 '{ ... }': ()
|
||||
498..502 'self': SelectStatement<F, S, D, W, O, LOf, {unknown}, {unknown}>
|
||||
498..508 'self.order': O
|
||||
498..515 'self.o...into()': dyn QueryFragment<DB>
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -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<i64> {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
65..79 '{ Self(0i64) }': Foo<i64>
|
||||
67..71 'Self': Foo<i64>(i64) -> Foo<i64>
|
||||
67..77 'Self(0i64)': Foo<i64>
|
||||
72..76 '0i64': i64
|
||||
64..78 '{ Self(0i64) }': Foo<i64>
|
||||
66..70 'Self': Foo<i64>(i64) -> Foo<i64>
|
||||
66..76 'Self(0i64)': Foo<i64>
|
||||
71..75 '0i64': i64
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -685,11 +685,11 @@ fn check<T: PrimInt>(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<Output = <K as Foo<R>>::Bar>
|
||||
205..208 'bar': fn bar<R, K>(&K) -> impl Future<Output = <K as Foo<R>>::Bar>
|
||||
205..213 'bar(key)': impl Future<Output = <K as Foo<R>>::Bar>
|
||||
209..212 'key': &K
|
||||
229..232 'key': &K
|
||||
291..294 '{ }': ()
|
||||
136..139 'key': &K
|
||||
198..214 '{ ...key) }': impl Future<Output = <K as Foo<R>>::Bar>
|
||||
204..207 'bar': fn bar<R, K>(&K) -> impl Future<Output = <K as Foo<R>>::Bar>
|
||||
204..212 'bar(key)': impl Future<Output = <K as Foo<R>>::Bar>
|
||||
208..211 'key': &K
|
||||
228..231 'key': &K
|
||||
290..293 '{ }': ()
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -776,11 +776,11 @@ pub trait Service<Request> {
|
|||
}
|
||||
"#),
|
||||
@r###"
|
||||
380..384 'self': &mut PeerSet<D>
|
||||
402..425 '{ ... }': dyn Future<Output = ()>
|
||||
412..419 'loop {}': !
|
||||
417..419 '{}': ()
|
||||
576..580 'self': &mut Self
|
||||
379..383 'self': &mut PeerSet<D>
|
||||
401..424 '{ ... }': dyn Future<Output = ()>
|
||||
411..418 'loop {}': !
|
||||
416..418 '{}': ()
|
||||
575..579 'self': &mut Self
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue