diff options
Diffstat (limited to 'crates/assists/src/tests')
-rw-r--r-- | crates/assists/src/tests/generated.rs | 223 |
1 files changed, 155 insertions, 68 deletions
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index d3dfe24e7..217f577eb 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs | |||
@@ -8,7 +8,7 @@ fn doctest_add_explicit_type() { | |||
8 | "add_explicit_type", | 8 | "add_explicit_type", |
9 | r#####" | 9 | r#####" |
10 | fn main() { | 10 | fn main() { |
11 | let x<|> = 92; | 11 | let x$0 = 92; |
12 | } | 12 | } |
13 | "#####, | 13 | "#####, |
14 | r#####" | 14 | r#####" |
@@ -25,7 +25,7 @@ fn doctest_add_hash() { | |||
25 | "add_hash", | 25 | "add_hash", |
26 | r#####" | 26 | r#####" |
27 | fn main() { | 27 | fn main() { |
28 | r#"Hello,<|> World!"#; | 28 | r#"Hello,$0 World!"#; |
29 | } | 29 | } |
30 | "#####, | 30 | "#####, |
31 | r#####" | 31 | r#####" |
@@ -49,7 +49,7 @@ trait Trait { | |||
49 | 49 | ||
50 | impl Trait for () { | 50 | impl Trait for () { |
51 | type X = (); | 51 | type X = (); |
52 | fn foo(&self) {}<|> | 52 | fn foo(&self) {}$0 |
53 | 53 | ||
54 | } | 54 | } |
55 | "#####, | 55 | "#####, |
@@ -81,7 +81,7 @@ trait Trait<T> { | |||
81 | fn bar(&self) {} | 81 | fn bar(&self) {} |
82 | } | 82 | } |
83 | 83 | ||
84 | impl Trait<u32> for () {<|> | 84 | impl Trait<u32> for () {$0 |
85 | 85 | ||
86 | } | 86 | } |
87 | "#####, | 87 | "#####, |
@@ -110,7 +110,7 @@ fn doctest_add_turbo_fish() { | |||
110 | r#####" | 110 | r#####" |
111 | fn make<T>() -> T { todo!() } | 111 | fn make<T>() -> T { todo!() } |
112 | fn main() { | 112 | fn main() { |
113 | let x = make<|>(); | 113 | let x = make$0(); |
114 | } | 114 | } |
115 | "#####, | 115 | "#####, |
116 | r#####" | 116 | r#####" |
@@ -128,7 +128,7 @@ fn doctest_apply_demorgan() { | |||
128 | "apply_demorgan", | 128 | "apply_demorgan", |
129 | r#####" | 129 | r#####" |
130 | fn main() { | 130 | fn main() { |
131 | if x != 4 ||<|> !y {} | 131 | if x != 4 ||$0 !y {} |
132 | } | 132 | } |
133 | "#####, | 133 | "#####, |
134 | r#####" | 134 | r#####" |
@@ -145,7 +145,7 @@ fn doctest_auto_import() { | |||
145 | "auto_import", | 145 | "auto_import", |
146 | r#####" | 146 | r#####" |
147 | fn main() { | 147 | fn main() { |
148 | let map = HashMap<|>::new(); | 148 | let map = HashMap$0::new(); |
149 | } | 149 | } |
150 | pub mod std { pub mod collections { pub struct HashMap { } } } | 150 | pub mod std { pub mod collections { pub struct HashMap { } } } |
151 | "#####, | 151 | "#####, |
@@ -165,7 +165,7 @@ fn doctest_change_visibility() { | |||
165 | check_doc_test( | 165 | check_doc_test( |
166 | "change_visibility", | 166 | "change_visibility", |
167 | r#####" | 167 | r#####" |
168 | <|>fn frobnicate() {} | 168 | $0fn frobnicate() {} |
169 | "#####, | 169 | "#####, |
170 | r#####" | 170 | r#####" |
171 | pub(crate) fn frobnicate() {} | 171 | pub(crate) fn frobnicate() {} |
@@ -178,7 +178,7 @@ fn doctest_convert_integer_literal() { | |||
178 | check_doc_test( | 178 | check_doc_test( |
179 | "convert_integer_literal", | 179 | "convert_integer_literal", |
180 | r#####" | 180 | r#####" |
181 | const _: i32 = 10<|>; | 181 | const _: i32 = 10$0; |
182 | "#####, | 182 | "#####, |
183 | r#####" | 183 | r#####" |
184 | const _: i32 = 0b1010; | 184 | const _: i32 = 0b1010; |
@@ -192,7 +192,7 @@ fn doctest_convert_to_guarded_return() { | |||
192 | "convert_to_guarded_return", | 192 | "convert_to_guarded_return", |
193 | r#####" | 193 | r#####" |
194 | fn main() { | 194 | fn main() { |
195 | <|>if cond { | 195 | $0if cond { |
196 | foo(); | 196 | foo(); |
197 | bar(); | 197 | bar(); |
198 | } | 198 | } |
@@ -220,7 +220,7 @@ mod foo { | |||
220 | pub struct Baz; | 220 | pub struct Baz; |
221 | } | 221 | } |
222 | 222 | ||
223 | use foo::*<|>; | 223 | use foo::*$0; |
224 | 224 | ||
225 | fn qux(bar: Bar, baz: Baz) {} | 225 | fn qux(bar: Bar, baz: Baz) {} |
226 | "#####, | 226 | "#####, |
@@ -238,26 +238,11 @@ fn qux(bar: Bar, baz: Baz) {} | |||
238 | } | 238 | } |
239 | 239 | ||
240 | #[test] | 240 | #[test] |
241 | fn doctest_extract_module_to_file() { | ||
242 | check_doc_test( | ||
243 | "extract_module_to_file", | ||
244 | r#####" | ||
245 | mod foo {<|> | ||
246 | fn t() {} | ||
247 | } | ||
248 | "#####, | ||
249 | r#####" | ||
250 | mod foo; | ||
251 | "#####, | ||
252 | ) | ||
253 | } | ||
254 | |||
255 | #[test] | ||
256 | fn doctest_extract_struct_from_enum_variant() { | 241 | fn doctest_extract_struct_from_enum_variant() { |
257 | check_doc_test( | 242 | check_doc_test( |
258 | "extract_struct_from_enum_variant", | 243 | "extract_struct_from_enum_variant", |
259 | r#####" | 244 | r#####" |
260 | enum A { <|>One(u32, u32) } | 245 | enum A { $0One(u32, u32) } |
261 | "#####, | 246 | "#####, |
262 | r#####" | 247 | r#####" |
263 | struct One(pub u32, pub u32); | 248 | struct One(pub u32, pub u32); |
@@ -273,7 +258,7 @@ fn doctest_extract_variable() { | |||
273 | "extract_variable", | 258 | "extract_variable", |
274 | r#####" | 259 | r#####" |
275 | fn main() { | 260 | fn main() { |
276 | <|>(1 + 2)<|> * 4; | 261 | $0(1 + 2)$0 * 4; |
277 | } | 262 | } |
278 | "#####, | 263 | "#####, |
279 | r#####" | 264 | r#####" |
@@ -294,7 +279,7 @@ enum Action { Move { distance: u32 }, Stop } | |||
294 | 279 | ||
295 | fn handle(action: Action) { | 280 | fn handle(action: Action) { |
296 | match action { | 281 | match action { |
297 | <|> | 282 | $0 |
298 | } | 283 | } |
299 | } | 284 | } |
300 | "#####, | 285 | "#####, |
@@ -320,7 +305,7 @@ mod m { | |||
320 | fn frobnicate() {} | 305 | fn frobnicate() {} |
321 | } | 306 | } |
322 | fn main() { | 307 | fn main() { |
323 | m::frobnicate<|>() {} | 308 | m::frobnicate$0() {} |
324 | } | 309 | } |
325 | "#####, | 310 | "#####, |
326 | r#####" | 311 | r#####" |
@@ -340,7 +325,7 @@ fn doctest_flip_binexpr() { | |||
340 | "flip_binexpr", | 325 | "flip_binexpr", |
341 | r#####" | 326 | r#####" |
342 | fn main() { | 327 | fn main() { |
343 | let _ = 90 +<|> 2; | 328 | let _ = 90 +$0 2; |
344 | } | 329 | } |
345 | "#####, | 330 | "#####, |
346 | r#####" | 331 | r#####" |
@@ -357,7 +342,7 @@ fn doctest_flip_comma() { | |||
357 | "flip_comma", | 342 | "flip_comma", |
358 | r#####" | 343 | r#####" |
359 | fn main() { | 344 | fn main() { |
360 | ((1, 2),<|> (3, 4)); | 345 | ((1, 2),$0 (3, 4)); |
361 | } | 346 | } |
362 | "#####, | 347 | "#####, |
363 | r#####" | 348 | r#####" |
@@ -373,7 +358,7 @@ fn doctest_flip_trait_bound() { | |||
373 | check_doc_test( | 358 | check_doc_test( |
374 | "flip_trait_bound", | 359 | "flip_trait_bound", |
375 | r#####" | 360 | r#####" |
376 | fn foo<T: Clone +<|> Copy>() { } | 361 | fn foo<T: Clone +$0 Copy>() { } |
377 | "#####, | 362 | "#####, |
378 | r#####" | 363 | r#####" |
379 | fn foo<T: Copy + Clone>() { } | 364 | fn foo<T: Copy + Clone>() { } |
@@ -388,7 +373,7 @@ fn doctest_generate_default_from_enum_variant() { | |||
388 | r#####" | 373 | r#####" |
389 | enum Version { | 374 | enum Version { |
390 | Undefined, | 375 | Undefined, |
391 | Minor<|>, | 376 | Minor$0, |
392 | Major, | 377 | Major, |
393 | } | 378 | } |
394 | "#####, | 379 | "#####, |
@@ -415,7 +400,7 @@ fn doctest_generate_derive() { | |||
415 | r#####" | 400 | r#####" |
416 | struct Point { | 401 | struct Point { |
417 | x: u32, | 402 | x: u32, |
418 | y: u32,<|> | 403 | y: u32,$0 |
419 | } | 404 | } |
420 | "#####, | 405 | "#####, |
421 | r#####" | 406 | r#####" |
@@ -433,7 +418,7 @@ fn doctest_generate_from_impl_for_enum() { | |||
433 | check_doc_test( | 418 | check_doc_test( |
434 | "generate_from_impl_for_enum", | 419 | "generate_from_impl_for_enum", |
435 | r#####" | 420 | r#####" |
436 | enum A { <|>One(u32) } | 421 | enum A { $0One(u32) } |
437 | "#####, | 422 | "#####, |
438 | r#####" | 423 | r#####" |
439 | enum A { One(u32) } | 424 | enum A { One(u32) } |
@@ -455,7 +440,7 @@ fn doctest_generate_function() { | |||
455 | struct Baz; | 440 | struct Baz; |
456 | fn baz() -> Baz { Baz } | 441 | fn baz() -> Baz { Baz } |
457 | fn foo() { | 442 | fn foo() { |
458 | bar<|>("", baz()); | 443 | bar$0("", baz()); |
459 | } | 444 | } |
460 | 445 | ||
461 | "#####, | 446 | "#####, |
@@ -480,7 +465,7 @@ fn doctest_generate_impl() { | |||
480 | "generate_impl", | 465 | "generate_impl", |
481 | r#####" | 466 | r#####" |
482 | struct Ctx<T: Clone> { | 467 | struct Ctx<T: Clone> { |
483 | data: T,<|> | 468 | data: T,$0 |
484 | } | 469 | } |
485 | "#####, | 470 | "#####, |
486 | r#####" | 471 | r#####" |
@@ -501,7 +486,7 @@ fn doctest_generate_new() { | |||
501 | "generate_new", | 486 | "generate_new", |
502 | r#####" | 487 | r#####" |
503 | struct Ctx<T: Clone> { | 488 | struct Ctx<T: Clone> { |
504 | data: T,<|> | 489 | data: T,$0 |
505 | } | 490 | } |
506 | "#####, | 491 | "#####, |
507 | r#####" | 492 | r#####" |
@@ -522,7 +507,7 @@ fn doctest_infer_function_return_type() { | |||
522 | check_doc_test( | 507 | check_doc_test( |
523 | "infer_function_return_type", | 508 | "infer_function_return_type", |
524 | r#####" | 509 | r#####" |
525 | fn foo() { 4<|>2i32 } | 510 | fn foo() { 4$02i32 } |
526 | "#####, | 511 | "#####, |
527 | r#####" | 512 | r#####" |
528 | fn foo() -> i32 { 42i32 } | 513 | fn foo() -> i32 { 42i32 } |
@@ -531,12 +516,35 @@ fn foo() -> i32 { 42i32 } | |||
531 | } | 516 | } |
532 | 517 | ||
533 | #[test] | 518 | #[test] |
519 | fn doctest_inline_function() { | ||
520 | check_doc_test( | ||
521 | "inline_function", | ||
522 | r#####" | ||
523 | fn add(a: u32, b: u32) -> u32 { a + b } | ||
524 | fn main() { | ||
525 | let x = add$0(1, 2); | ||
526 | } | ||
527 | "#####, | ||
528 | r#####" | ||
529 | fn add(a: u32, b: u32) -> u32 { a + b } | ||
530 | fn main() { | ||
531 | let x = { | ||
532 | let a = 1; | ||
533 | let b = 2; | ||
534 | a + b | ||
535 | }; | ||
536 | } | ||
537 | "#####, | ||
538 | ) | ||
539 | } | ||
540 | |||
541 | #[test] | ||
534 | fn doctest_inline_local_variable() { | 542 | fn doctest_inline_local_variable() { |
535 | check_doc_test( | 543 | check_doc_test( |
536 | "inline_local_variable", | 544 | "inline_local_variable", |
537 | r#####" | 545 | r#####" |
538 | fn main() { | 546 | fn main() { |
539 | let x<|> = 1 + 2; | 547 | let x$0 = 1 + 2; |
540 | x * 4; | 548 | x * 4; |
541 | } | 549 | } |
542 | "#####, | 550 | "#####, |
@@ -553,7 +561,7 @@ fn doctest_introduce_named_lifetime() { | |||
553 | check_doc_test( | 561 | check_doc_test( |
554 | "introduce_named_lifetime", | 562 | "introduce_named_lifetime", |
555 | r#####" | 563 | r#####" |
556 | impl Cursor<'_<|>> { | 564 | impl Cursor<'_$0> { |
557 | fn node(self) -> &SyntaxNode { | 565 | fn node(self) -> &SyntaxNode { |
558 | match self { | 566 | match self { |
559 | Cursor::Replace(node) | Cursor::Before(node) => node, | 567 | Cursor::Replace(node) | Cursor::Before(node) => node, |
@@ -579,7 +587,7 @@ fn doctest_invert_if() { | |||
579 | "invert_if", | 587 | "invert_if", |
580 | r#####" | 588 | r#####" |
581 | fn main() { | 589 | fn main() { |
582 | if<|> !y { A } else { B } | 590 | if$0 !y { A } else { B } |
583 | } | 591 | } |
584 | "#####, | 592 | "#####, |
585 | r#####" | 593 | r#####" |
@@ -596,7 +604,7 @@ fn doctest_make_raw_string() { | |||
596 | "make_raw_string", | 604 | "make_raw_string", |
597 | r#####" | 605 | r#####" |
598 | fn main() { | 606 | fn main() { |
599 | "Hello,<|> World!"; | 607 | "Hello,$0 World!"; |
600 | } | 608 | } |
601 | "#####, | 609 | "#####, |
602 | r#####" | 610 | r#####" |
@@ -613,7 +621,7 @@ fn doctest_make_usual_string() { | |||
613 | "make_usual_string", | 621 | "make_usual_string", |
614 | r#####" | 622 | r#####" |
615 | fn main() { | 623 | fn main() { |
616 | r#"Hello,<|> "World!""#; | 624 | r#"Hello,$0 "World!""#; |
617 | } | 625 | } |
618 | "#####, | 626 | "#####, |
619 | r#####" | 627 | r#####" |
@@ -629,7 +637,7 @@ fn doctest_merge_imports() { | |||
629 | check_doc_test( | 637 | check_doc_test( |
630 | "merge_imports", | 638 | "merge_imports", |
631 | r#####" | 639 | r#####" |
632 | use std::<|>fmt::Formatter; | 640 | use std::$0fmt::Formatter; |
633 | use std::io; | 641 | use std::io; |
634 | "#####, | 642 | "#####, |
635 | r#####" | 643 | r#####" |
@@ -647,7 +655,7 @@ enum Action { Move { distance: u32 }, Stop } | |||
647 | 655 | ||
648 | fn handle(action: Action) { | 656 | fn handle(action: Action) { |
649 | match action { | 657 | match action { |
650 | <|>Action::Move(..) => foo(), | 658 | $0Action::Move(..) => foo(), |
651 | Action::Stop => foo(), | 659 | Action::Stop => foo(), |
652 | } | 660 | } |
653 | } | 661 | } |
@@ -673,7 +681,7 @@ enum Action { Move { distance: u32 }, Stop } | |||
673 | 681 | ||
674 | fn handle(action: Action) { | 682 | fn handle(action: Action) { |
675 | match action { | 683 | match action { |
676 | Action::Move { distance } => <|>if distance > 10 { foo() }, | 684 | Action::Move { distance } => $0if distance > 10 { foo() }, |
677 | _ => (), | 685 | _ => (), |
678 | } | 686 | } |
679 | } | 687 | } |
@@ -696,7 +704,7 @@ fn doctest_move_bounds_to_where_clause() { | |||
696 | check_doc_test( | 704 | check_doc_test( |
697 | "move_bounds_to_where_clause", | 705 | "move_bounds_to_where_clause", |
698 | r#####" | 706 | r#####" |
699 | fn apply<T, U, <|>F: FnOnce(T) -> U>(f: F, x: T) -> U { | 707 | fn apply<T, U, $0F: FnOnce(T) -> U>(f: F, x: T) -> U { |
700 | f(x) | 708 | f(x) |
701 | } | 709 | } |
702 | "#####, | 710 | "#####, |
@@ -717,7 +725,7 @@ enum Action { Move { distance: u32 }, Stop } | |||
717 | 725 | ||
718 | fn handle(action: Action) { | 726 | fn handle(action: Action) { |
719 | match action { | 727 | match action { |
720 | Action::Move { distance } <|>if distance > 10 => foo(), | 728 | Action::Move { distance } $0if distance > 10 => foo(), |
721 | _ => (), | 729 | _ => (), |
722 | } | 730 | } |
723 | } | 731 | } |
@@ -738,12 +746,56 @@ fn handle(action: Action) { | |||
738 | } | 746 | } |
739 | 747 | ||
740 | #[test] | 748 | #[test] |
749 | fn doctest_move_module_to_file() { | ||
750 | check_doc_test( | ||
751 | "move_module_to_file", | ||
752 | r#####" | ||
753 | mod $0foo { | ||
754 | fn t() {} | ||
755 | } | ||
756 | "#####, | ||
757 | r#####" | ||
758 | mod foo; | ||
759 | "#####, | ||
760 | ) | ||
761 | } | ||
762 | |||
763 | #[test] | ||
764 | fn doctest_pull_assignment_up() { | ||
765 | check_doc_test( | ||
766 | "pull_assignment_up", | ||
767 | r#####" | ||
768 | fn main() { | ||
769 | let mut foo = 6; | ||
770 | |||
771 | if true { | ||
772 | $0foo = 5; | ||
773 | } else { | ||
774 | foo = 4; | ||
775 | } | ||
776 | } | ||
777 | "#####, | ||
778 | r#####" | ||
779 | fn main() { | ||
780 | let mut foo = 6; | ||
781 | |||
782 | foo = if true { | ||
783 | 5 | ||
784 | } else { | ||
785 | 4 | ||
786 | }; | ||
787 | } | ||
788 | "#####, | ||
789 | ) | ||
790 | } | ||
791 | |||
792 | #[test] | ||
741 | fn doctest_qualify_path() { | 793 | fn doctest_qualify_path() { |
742 | check_doc_test( | 794 | check_doc_test( |
743 | "qualify_path", | 795 | "qualify_path", |
744 | r#####" | 796 | r#####" |
745 | fn main() { | 797 | fn main() { |
746 | let map = HashMap<|>::new(); | 798 | let map = HashMap$0::new(); |
747 | } | 799 | } |
748 | pub mod std { pub mod collections { pub struct HashMap { } } } | 800 | pub mod std { pub mod collections { pub struct HashMap { } } } |
749 | "#####, | 801 | "#####, |
@@ -762,7 +814,7 @@ fn doctest_remove_dbg() { | |||
762 | "remove_dbg", | 814 | "remove_dbg", |
763 | r#####" | 815 | r#####" |
764 | fn main() { | 816 | fn main() { |
765 | <|>dbg!(92); | 817 | $0dbg!(92); |
766 | } | 818 | } |
767 | "#####, | 819 | "#####, |
768 | r#####" | 820 | r#####" |
@@ -779,7 +831,7 @@ fn doctest_remove_hash() { | |||
779 | "remove_hash", | 831 | "remove_hash", |
780 | r#####" | 832 | r#####" |
781 | fn main() { | 833 | fn main() { |
782 | r#"Hello,<|> World!"#; | 834 | r#"Hello,$0 World!"#; |
783 | } | 835 | } |
784 | "#####, | 836 | "#####, |
785 | r#####" | 837 | r#####" |
@@ -796,7 +848,7 @@ fn doctest_remove_mut() { | |||
796 | "remove_mut", | 848 | "remove_mut", |
797 | r#####" | 849 | r#####" |
798 | impl Walrus { | 850 | impl Walrus { |
799 | fn feed(&mut<|> self, amount: u32) {} | 851 | fn feed(&mut$0 self, amount: u32) {} |
800 | } | 852 | } |
801 | "#####, | 853 | "#####, |
802 | r#####" | 854 | r#####" |
@@ -812,7 +864,7 @@ fn doctest_remove_unused_param() { | |||
812 | check_doc_test( | 864 | check_doc_test( |
813 | "remove_unused_param", | 865 | "remove_unused_param", |
814 | r#####" | 866 | r#####" |
815 | fn frobnicate(x: i32<|>) {} | 867 | fn frobnicate(x: i32$0) {} |
816 | 868 | ||
817 | fn main() { | 869 | fn main() { |
818 | frobnicate(92); | 870 | frobnicate(92); |
@@ -834,7 +886,7 @@ fn doctest_reorder_fields() { | |||
834 | "reorder_fields", | 886 | "reorder_fields", |
835 | r#####" | 887 | r#####" |
836 | struct Foo {foo: i32, bar: i32}; | 888 | struct Foo {foo: i32, bar: i32}; |
837 | const test: Foo = <|>Foo {bar: 0, foo: 1} | 889 | const test: Foo = $0Foo {bar: 0, foo: 1} |
838 | "#####, | 890 | "#####, |
839 | r#####" | 891 | r#####" |
840 | struct Foo {foo: i32, bar: i32}; | 892 | struct Foo {foo: i32, bar: i32}; |
@@ -844,12 +896,47 @@ const test: Foo = Foo {foo: 1, bar: 0} | |||
844 | } | 896 | } |
845 | 897 | ||
846 | #[test] | 898 | #[test] |
899 | fn doctest_reorder_impl() { | ||
900 | check_doc_test( | ||
901 | "reorder_impl", | ||
902 | r#####" | ||
903 | trait Foo { | ||
904 | fn a() {} | ||
905 | fn b() {} | ||
906 | fn c() {} | ||
907 | } | ||
908 | |||
909 | struct Bar; | ||
910 | $0impl Foo for Bar { | ||
911 | fn b() {} | ||
912 | fn c() {} | ||
913 | fn a() {} | ||
914 | } | ||
915 | "#####, | ||
916 | r#####" | ||
917 | trait Foo { | ||
918 | fn a() {} | ||
919 | fn b() {} | ||
920 | fn c() {} | ||
921 | } | ||
922 | |||
923 | struct Bar; | ||
924 | impl Foo for Bar { | ||
925 | fn a() {} | ||
926 | fn b() {} | ||
927 | fn c() {} | ||
928 | } | ||
929 | "#####, | ||
930 | ) | ||
931 | } | ||
932 | |||
933 | #[test] | ||
847 | fn doctest_replace_derive_with_manual_impl() { | 934 | fn doctest_replace_derive_with_manual_impl() { |
848 | check_doc_test( | 935 | check_doc_test( |
849 | "replace_derive_with_manual_impl", | 936 | "replace_derive_with_manual_impl", |
850 | r#####" | 937 | r#####" |
851 | trait Debug { fn fmt(&self, f: &mut Formatter) -> Result<()>; } | 938 | trait Debug { fn fmt(&self, f: &mut Formatter) -> Result<()>; } |
852 | #[derive(Deb<|>ug, Display)] | 939 | #[derive(Deb$0ug, Display)] |
853 | struct S; | 940 | struct S; |
854 | "#####, | 941 | "#####, |
855 | r#####" | 942 | r#####" |
@@ -874,7 +961,7 @@ fn doctest_replace_if_let_with_match() { | |||
874 | enum Action { Move { distance: u32 }, Stop } | 961 | enum Action { Move { distance: u32 }, Stop } |
875 | 962 | ||
876 | fn handle(action: Action) { | 963 | fn handle(action: Action) { |
877 | <|>if let Action::Move { distance } = action { | 964 | $0if let Action::Move { distance } = action { |
878 | foo(distance) | 965 | foo(distance) |
879 | } else { | 966 | } else { |
880 | bar() | 967 | bar() |
@@ -899,7 +986,7 @@ fn doctest_replace_impl_trait_with_generic() { | |||
899 | check_doc_test( | 986 | check_doc_test( |
900 | "replace_impl_trait_with_generic", | 987 | "replace_impl_trait_with_generic", |
901 | r#####" | 988 | r#####" |
902 | fn foo(bar: <|>impl Bar) {} | 989 | fn foo(bar: $0impl Bar) {} |
903 | "#####, | 990 | "#####, |
904 | r#####" | 991 | r#####" |
905 | fn foo<B: Bar>(bar: B) {} | 992 | fn foo<B: Bar>(bar: B) {} |
@@ -915,7 +1002,7 @@ fn doctest_replace_let_with_if_let() { | |||
915 | enum Option<T> { Some(T), None } | 1002 | enum Option<T> { Some(T), None } |
916 | 1003 | ||
917 | fn main(action: Action) { | 1004 | fn main(action: Action) { |
918 | <|>let x = compute(); | 1005 | $0let x = compute(); |
919 | } | 1006 | } |
920 | 1007 | ||
921 | fn compute() -> Option<i32> { None } | 1008 | fn compute() -> Option<i32> { None } |
@@ -941,7 +1028,7 @@ fn doctest_replace_match_with_if_let() { | |||
941 | enum Action { Move { distance: u32 }, Stop } | 1028 | enum Action { Move { distance: u32 }, Stop } |
942 | 1029 | ||
943 | fn handle(action: Action) { | 1030 | fn handle(action: Action) { |
944 | <|>match action { | 1031 | $0match action { |
945 | Action::Move { distance } => foo(distance), | 1032 | Action::Move { distance } => foo(distance), |
946 | _ => bar(), | 1033 | _ => bar(), |
947 | } | 1034 | } |
@@ -966,7 +1053,7 @@ fn doctest_replace_qualified_name_with_use() { | |||
966 | check_doc_test( | 1053 | check_doc_test( |
967 | "replace_qualified_name_with_use", | 1054 | "replace_qualified_name_with_use", |
968 | r#####" | 1055 | r#####" |
969 | fn process(map: std::collections::<|>HashMap<String, String>) {} | 1056 | fn process(map: std::collections::$0HashMap<String, String>) {} |
970 | "#####, | 1057 | "#####, |
971 | r#####" | 1058 | r#####" |
972 | use std::collections::HashMap; | 1059 | use std::collections::HashMap; |
@@ -982,7 +1069,7 @@ fn doctest_replace_string_with_char() { | |||
982 | "replace_string_with_char", | 1069 | "replace_string_with_char", |
983 | r#####" | 1070 | r#####" |
984 | fn main() { | 1071 | fn main() { |
985 | find("{<|>"); | 1072 | find("{$0"); |
986 | } | 1073 | } |
987 | "#####, | 1074 | "#####, |
988 | r#####" | 1075 | r#####" |
@@ -1001,7 +1088,7 @@ fn doctest_replace_unwrap_with_match() { | |||
1001 | enum Result<T, E> { Ok(T), Err(E) } | 1088 | enum Result<T, E> { Ok(T), Err(E) } |
1002 | fn main() { | 1089 | fn main() { |
1003 | let x: Result<i32, i32> = Result::Ok(92); | 1090 | let x: Result<i32, i32> = Result::Ok(92); |
1004 | let y = x.<|>unwrap(); | 1091 | let y = x.$0unwrap(); |
1005 | } | 1092 | } |
1006 | "#####, | 1093 | "#####, |
1007 | r#####" | 1094 | r#####" |
@@ -1022,7 +1109,7 @@ fn doctest_split_import() { | |||
1022 | check_doc_test( | 1109 | check_doc_test( |
1023 | "split_import", | 1110 | "split_import", |
1024 | r#####" | 1111 | r#####" |
1025 | use std::<|>collections::HashMap; | 1112 | use std::$0collections::HashMap; |
1026 | "#####, | 1113 | "#####, |
1027 | r#####" | 1114 | r#####" |
1028 | use std::{collections::HashMap}; | 1115 | use std::{collections::HashMap}; |
@@ -1035,7 +1122,7 @@ fn doctest_toggle_ignore() { | |||
1035 | check_doc_test( | 1122 | check_doc_test( |
1036 | "toggle_ignore", | 1123 | "toggle_ignore", |
1037 | r#####" | 1124 | r#####" |
1038 | <|>#[test] | 1125 | $0#[test] |
1039 | fn arithmetics { | 1126 | fn arithmetics { |
1040 | assert_eq!(2 + 2, 5); | 1127 | assert_eq!(2 + 2, 5); |
1041 | } | 1128 | } |
@@ -1056,7 +1143,7 @@ fn doctest_unwrap_block() { | |||
1056 | "unwrap_block", | 1143 | "unwrap_block", |
1057 | r#####" | 1144 | r#####" |
1058 | fn foo() { | 1145 | fn foo() { |
1059 | if true {<|> | 1146 | if true {$0 |
1060 | println!("foo"); | 1147 | println!("foo"); |
1061 | } | 1148 | } |
1062 | } | 1149 | } |
@@ -1074,7 +1161,7 @@ fn doctest_wrap_return_type_in_result() { | |||
1074 | check_doc_test( | 1161 | check_doc_test( |
1075 | "wrap_return_type_in_result", | 1162 | "wrap_return_type_in_result", |
1076 | r#####" | 1163 | r#####" |
1077 | fn foo() -> i32<|> { 42i32 } | 1164 | fn foo() -> i32$0 { 42i32 } |
1078 | "#####, | 1165 | "#####, |
1079 | r#####" | 1166 | r#####" |
1080 | fn foo() -> Result<i32, ${0:_}> { Ok(42i32) } | 1167 | fn foo() -> Result<i32, ${0:_}> { Ok(42i32) } |