aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/tests')
-rw-r--r--crates/assists/src/tests/generated.rs1184
1 files changed, 0 insertions, 1184 deletions
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs
deleted file mode 100644
index d48d063b4..000000000
--- a/crates/assists/src/tests/generated.rs
+++ /dev/null
@@ -1,1184 +0,0 @@
1//! Generated file, do not edit by hand, see `xtask/src/codegen`
2
3use super::check_doc_test;
4
5#[test]
6fn doctest_add_explicit_type() {
7 check_doc_test(
8 "add_explicit_type",
9 r#####"
10fn main() {
11 let x$0 = 92;
12}
13"#####,
14 r#####"
15fn main() {
16 let x: i32 = 92;
17}
18"#####,
19 )
20}
21
22#[test]
23fn doctest_add_hash() {
24 check_doc_test(
25 "add_hash",
26 r#####"
27fn main() {
28 r#"Hello,$0 World!"#;
29}
30"#####,
31 r#####"
32fn main() {
33 r##"Hello, World!"##;
34}
35"#####,
36 )
37}
38
39#[test]
40fn doctest_add_impl_default_members() {
41 check_doc_test(
42 "add_impl_default_members",
43 r#####"
44trait Trait {
45 type X;
46 fn foo(&self);
47 fn bar(&self) {}
48}
49
50impl Trait for () {
51 type X = ();
52 fn foo(&self) {}$0
53
54}
55"#####,
56 r#####"
57trait Trait {
58 type X;
59 fn foo(&self);
60 fn bar(&self) {}
61}
62
63impl Trait for () {
64 type X = ();
65 fn foo(&self) {}
66
67 $0fn bar(&self) {}
68}
69"#####,
70 )
71}
72
73#[test]
74fn doctest_add_impl_missing_members() {
75 check_doc_test(
76 "add_impl_missing_members",
77 r#####"
78trait Trait<T> {
79 type X;
80 fn foo(&self) -> T;
81 fn bar(&self) {}
82}
83
84impl Trait<u32> for () {$0
85
86}
87"#####,
88 r#####"
89trait Trait<T> {
90 type X;
91 fn foo(&self) -> T;
92 fn bar(&self) {}
93}
94
95impl Trait<u32> for () {
96 $0type X;
97
98 fn foo(&self) -> u32 {
99 todo!()
100 }
101}
102"#####,
103 )
104}
105
106#[test]
107fn doctest_add_turbo_fish() {
108 check_doc_test(
109 "add_turbo_fish",
110 r#####"
111fn make<T>() -> T { todo!() }
112fn main() {
113 let x = make$0();
114}
115"#####,
116 r#####"
117fn make<T>() -> T { todo!() }
118fn main() {
119 let x = make::<${0:_}>();
120}
121"#####,
122 )
123}
124
125#[test]
126fn doctest_apply_demorgan() {
127 check_doc_test(
128 "apply_demorgan",
129 r#####"
130fn main() {
131 if x != 4 ||$0 !y {}
132}
133"#####,
134 r#####"
135fn main() {
136 if !(x == 4 && y) {}
137}
138"#####,
139 )
140}
141
142#[test]
143fn doctest_auto_import() {
144 check_doc_test(
145 "auto_import",
146 r#####"
147fn main() {
148 let map = HashMap$0::new();
149}
150pub mod std { pub mod collections { pub struct HashMap { } } }
151"#####,
152 r#####"
153use std::collections::HashMap;
154
155fn main() {
156 let map = HashMap::new();
157}
158pub mod std { pub mod collections { pub struct HashMap { } } }
159"#####,
160 )
161}
162
163#[test]
164fn doctest_change_visibility() {
165 check_doc_test(
166 "change_visibility",
167 r#####"
168$0fn frobnicate() {}
169"#####,
170 r#####"
171pub(crate) fn frobnicate() {}
172"#####,
173 )
174}
175
176#[test]
177fn doctest_convert_integer_literal() {
178 check_doc_test(
179 "convert_integer_literal",
180 r#####"
181const _: i32 = 10$0;
182"#####,
183 r#####"
184const _: i32 = 0b1010;
185"#####,
186 )
187}
188
189#[test]
190fn doctest_convert_to_guarded_return() {
191 check_doc_test(
192 "convert_to_guarded_return",
193 r#####"
194fn main() {
195 $0if cond {
196 foo();
197 bar();
198 }
199}
200"#####,
201 r#####"
202fn main() {
203 if !cond {
204 return;
205 }
206 foo();
207 bar();
208}
209"#####,
210 )
211}
212
213#[test]
214fn doctest_expand_glob_import() {
215 check_doc_test(
216 "expand_glob_import",
217 r#####"
218mod foo {
219 pub struct Bar;
220 pub struct Baz;
221}
222
223use foo::*$0;
224
225fn qux(bar: Bar, baz: Baz) {}
226"#####,
227 r#####"
228mod foo {
229 pub struct Bar;
230 pub struct Baz;
231}
232
233use foo::{Baz, Bar};
234
235fn qux(bar: Bar, baz: Baz) {}
236"#####,
237 )
238}
239
240#[test]
241fn doctest_extract_struct_from_enum_variant() {
242 check_doc_test(
243 "extract_struct_from_enum_variant",
244 r#####"
245enum A { $0One(u32, u32) }
246"#####,
247 r#####"
248struct One(pub u32, pub u32);
249
250enum A { One(One) }
251"#####,
252 )
253}
254
255#[test]
256fn doctest_extract_variable() {
257 check_doc_test(
258 "extract_variable",
259 r#####"
260fn main() {
261 $0(1 + 2)$0 * 4;
262}
263"#####,
264 r#####"
265fn main() {
266 let $0var_name = (1 + 2);
267 var_name * 4;
268}
269"#####,
270 )
271}
272
273#[test]
274fn doctest_fill_match_arms() {
275 check_doc_test(
276 "fill_match_arms",
277 r#####"
278enum Action { Move { distance: u32 }, Stop }
279
280fn handle(action: Action) {
281 match action {
282 $0
283 }
284}
285"#####,
286 r#####"
287enum Action { Move { distance: u32 }, Stop }
288
289fn handle(action: Action) {
290 match action {
291 $0Action::Move { distance } => {}
292 Action::Stop => {}
293 }
294}
295"#####,
296 )
297}
298
299#[test]
300fn doctest_fix_visibility() {
301 check_doc_test(
302 "fix_visibility",
303 r#####"
304mod m {
305 fn frobnicate() {}
306}
307fn main() {
308 m::frobnicate$0() {}
309}
310"#####,
311 r#####"
312mod m {
313 $0pub(crate) fn frobnicate() {}
314}
315fn main() {
316 m::frobnicate() {}
317}
318"#####,
319 )
320}
321
322#[test]
323fn doctest_flip_binexpr() {
324 check_doc_test(
325 "flip_binexpr",
326 r#####"
327fn main() {
328 let _ = 90 +$0 2;
329}
330"#####,
331 r#####"
332fn main() {
333 let _ = 2 + 90;
334}
335"#####,
336 )
337}
338
339#[test]
340fn doctest_flip_comma() {
341 check_doc_test(
342 "flip_comma",
343 r#####"
344fn main() {
345 ((1, 2),$0 (3, 4));
346}
347"#####,
348 r#####"
349fn main() {
350 ((3, 4), (1, 2));
351}
352"#####,
353 )
354}
355
356#[test]
357fn doctest_flip_trait_bound() {
358 check_doc_test(
359 "flip_trait_bound",
360 r#####"
361fn foo<T: Clone +$0 Copy>() { }
362"#####,
363 r#####"
364fn foo<T: Copy + Clone>() { }
365"#####,
366 )
367}
368
369#[test]
370fn doctest_generate_default_from_enum_variant() {
371 check_doc_test(
372 "generate_default_from_enum_variant",
373 r#####"
374enum Version {
375 Undefined,
376 Minor$0,
377 Major,
378}
379"#####,
380 r#####"
381enum Version {
382 Undefined,
383 Minor,
384 Major,
385}
386
387impl Default for Version {
388 fn default() -> Self {
389 Self::Minor
390 }
391}
392"#####,
393 )
394}
395
396#[test]
397fn doctest_generate_derive() {
398 check_doc_test(
399 "generate_derive",
400 r#####"
401struct Point {
402 x: u32,
403 y: u32,$0
404}
405"#####,
406 r#####"
407#[derive($0)]
408struct Point {
409 x: u32,
410 y: u32,
411}
412"#####,
413 )
414}
415
416#[test]
417fn doctest_generate_from_impl_for_enum() {
418 check_doc_test(
419 "generate_from_impl_for_enum",
420 r#####"
421enum A { $0One(u32) }
422"#####,
423 r#####"
424enum A { One(u32) }
425
426impl From<u32> for A {
427 fn from(v: u32) -> Self {
428 A::One(v)
429 }
430}
431"#####,
432 )
433}
434
435#[test]
436fn doctest_generate_function() {
437 check_doc_test(
438 "generate_function",
439 r#####"
440struct Baz;
441fn baz() -> Baz { Baz }
442fn foo() {
443 bar$0("", baz());
444}
445
446"#####,
447 r#####"
448struct Baz;
449fn baz() -> Baz { Baz }
450fn foo() {
451 bar("", baz());
452}
453
454fn bar(arg: &str, baz: Baz) ${0:-> ()} {
455 todo!()
456}
457
458"#####,
459 )
460}
461
462#[test]
463fn doctest_generate_impl() {
464 check_doc_test(
465 "generate_impl",
466 r#####"
467struct Ctx<T: Clone> {
468 data: T,$0
469}
470"#####,
471 r#####"
472struct Ctx<T: Clone> {
473 data: T,
474}
475
476impl<T: Clone> Ctx<T> {
477 $0
478}
479"#####,
480 )
481}
482
483#[test]
484fn doctest_generate_new() {
485 check_doc_test(
486 "generate_new",
487 r#####"
488struct Ctx<T: Clone> {
489 data: T,$0
490}
491"#####,
492 r#####"
493struct Ctx<T: Clone> {
494 data: T,
495}
496
497impl<T: Clone> Ctx<T> {
498 fn $0new(data: T) -> Self { Self { data } }
499}
500
501"#####,
502 )
503}
504
505#[test]
506fn doctest_infer_function_return_type() {
507 check_doc_test(
508 "infer_function_return_type",
509 r#####"
510fn foo() { 4$02i32 }
511"#####,
512 r#####"
513fn foo() -> i32 { 42i32 }
514"#####,
515 )
516}
517
518#[test]
519fn doctest_inline_function() {
520 check_doc_test(
521 "inline_function",
522 r#####"
523fn add(a: u32, b: u32) -> u32 { a + b }
524fn main() {
525 let x = add$0(1, 2);
526}
527"#####,
528 r#####"
529fn add(a: u32, b: u32) -> u32 { a + b }
530fn main() {
531 let x = {
532 let a = 1;
533 let b = 2;
534 a + b
535 };
536}
537"#####,
538 )
539}
540
541#[test]
542fn doctest_inline_local_variable() {
543 check_doc_test(
544 "inline_local_variable",
545 r#####"
546fn main() {
547 let x$0 = 1 + 2;
548 x * 4;
549}
550"#####,
551 r#####"
552fn main() {
553 (1 + 2) * 4;
554}
555"#####,
556 )
557}
558
559#[test]
560fn doctest_introduce_named_lifetime() {
561 check_doc_test(
562 "introduce_named_lifetime",
563 r#####"
564impl Cursor<'_$0> {
565 fn node(self) -> &SyntaxNode {
566 match self {
567 Cursor::Replace(node) | Cursor::Before(node) => node,
568 }
569 }
570}
571"#####,
572 r#####"
573impl<'a> Cursor<'a> {
574 fn node(self) -> &SyntaxNode {
575 match self {
576 Cursor::Replace(node) | Cursor::Before(node) => node,
577 }
578 }
579}
580"#####,
581 )
582}
583
584#[test]
585fn doctest_invert_if() {
586 check_doc_test(
587 "invert_if",
588 r#####"
589fn main() {
590 if$0 !y { A } else { B }
591}
592"#####,
593 r#####"
594fn main() {
595 if y { B } else { A }
596}
597"#####,
598 )
599}
600
601#[test]
602fn doctest_make_raw_string() {
603 check_doc_test(
604 "make_raw_string",
605 r#####"
606fn main() {
607 "Hello,$0 World!";
608}
609"#####,
610 r#####"
611fn main() {
612 r#"Hello, World!"#;
613}
614"#####,
615 )
616}
617
618#[test]
619fn doctest_make_usual_string() {
620 check_doc_test(
621 "make_usual_string",
622 r#####"
623fn main() {
624 r#"Hello,$0 "World!""#;
625}
626"#####,
627 r#####"
628fn main() {
629 "Hello, \"World!\"";
630}
631"#####,
632 )
633}
634
635#[test]
636fn doctest_merge_imports() {
637 check_doc_test(
638 "merge_imports",
639 r#####"
640use std::$0fmt::Formatter;
641use std::io;
642"#####,
643 r#####"
644use std::{fmt::Formatter, io};
645"#####,
646 )
647}
648
649#[test]
650fn doctest_merge_match_arms() {
651 check_doc_test(
652 "merge_match_arms",
653 r#####"
654enum Action { Move { distance: u32 }, Stop }
655
656fn handle(action: Action) {
657 match action {
658 $0Action::Move(..) => foo(),
659 Action::Stop => foo(),
660 }
661}
662"#####,
663 r#####"
664enum Action { Move { distance: u32 }, Stop }
665
666fn handle(action: Action) {
667 match action {
668 Action::Move(..) | Action::Stop => foo(),
669 }
670}
671"#####,
672 )
673}
674
675#[test]
676fn doctest_move_arm_cond_to_match_guard() {
677 check_doc_test(
678 "move_arm_cond_to_match_guard",
679 r#####"
680enum Action { Move { distance: u32 }, Stop }
681
682fn handle(action: Action) {
683 match action {
684 Action::Move { distance } => $0if distance > 10 { foo() },
685 _ => (),
686 }
687}
688"#####,
689 r#####"
690enum Action { Move { distance: u32 }, Stop }
691
692fn handle(action: Action) {
693 match action {
694 Action::Move { distance } if distance > 10 => foo(),
695 _ => (),
696 }
697}
698"#####,
699 )
700}
701
702#[test]
703fn doctest_move_bounds_to_where_clause() {
704 check_doc_test(
705 "move_bounds_to_where_clause",
706 r#####"
707fn apply<T, U, $0F: FnOnce(T) -> U>(f: F, x: T) -> U {
708 f(x)
709}
710"#####,
711 r#####"
712fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U {
713 f(x)
714}
715"#####,
716 )
717}
718
719#[test]
720fn doctest_move_guard_to_arm_body() {
721 check_doc_test(
722 "move_guard_to_arm_body",
723 r#####"
724enum Action { Move { distance: u32 }, Stop }
725
726fn handle(action: Action) {
727 match action {
728 Action::Move { distance } $0if distance > 10 => foo(),
729 _ => (),
730 }
731}
732"#####,
733 r#####"
734enum Action { Move { distance: u32 }, Stop }
735
736fn handle(action: Action) {
737 match action {
738 Action::Move { distance } => if distance > 10 {
739 foo()
740 },
741 _ => (),
742 }
743}
744"#####,
745 )
746}
747
748#[test]
749fn doctest_move_module_to_file() {
750 check_doc_test(
751 "move_module_to_file",
752 r#####"
753mod $0foo {
754 fn t() {}
755}
756"#####,
757 r#####"
758mod foo;
759"#####,
760 )
761}
762
763#[test]
764fn doctest_pull_assignment_up() {
765 check_doc_test(
766 "pull_assignment_up",
767 r#####"
768fn main() {
769 let mut foo = 6;
770
771 if true {
772 $0foo = 5;
773 } else {
774 foo = 4;
775 }
776}
777"#####,
778 r#####"
779fn 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]
793fn doctest_qualify_path() {
794 check_doc_test(
795 "qualify_path",
796 r#####"
797fn main() {
798 let map = HashMap$0::new();
799}
800pub mod std { pub mod collections { pub struct HashMap { } } }
801"#####,
802 r#####"
803fn main() {
804 let map = std::collections::HashMap::new();
805}
806pub mod std { pub mod collections { pub struct HashMap { } } }
807"#####,
808 )
809}
810
811#[test]
812fn doctest_remove_dbg() {
813 check_doc_test(
814 "remove_dbg",
815 r#####"
816fn main() {
817 $0dbg!(92);
818}
819"#####,
820 r#####"
821fn main() {
822 92;
823}
824"#####,
825 )
826}
827
828#[test]
829fn doctest_remove_hash() {
830 check_doc_test(
831 "remove_hash",
832 r#####"
833fn main() {
834 r#"Hello,$0 World!"#;
835}
836"#####,
837 r#####"
838fn main() {
839 r"Hello, World!";
840}
841"#####,
842 )
843}
844
845#[test]
846fn doctest_remove_mut() {
847 check_doc_test(
848 "remove_mut",
849 r#####"
850impl Walrus {
851 fn feed(&mut$0 self, amount: u32) {}
852}
853"#####,
854 r#####"
855impl Walrus {
856 fn feed(&self, amount: u32) {}
857}
858"#####,
859 )
860}
861
862#[test]
863fn doctest_remove_unused_param() {
864 check_doc_test(
865 "remove_unused_param",
866 r#####"
867fn frobnicate(x: i32$0) {}
868
869fn main() {
870 frobnicate(92);
871}
872"#####,
873 r#####"
874fn frobnicate() {}
875
876fn main() {
877 frobnicate();
878}
879"#####,
880 )
881}
882
883#[test]
884fn doctest_reorder_fields() {
885 check_doc_test(
886 "reorder_fields",
887 r#####"
888struct Foo {foo: i32, bar: i32};
889const test: Foo = $0Foo {bar: 0, foo: 1}
890"#####,
891 r#####"
892struct Foo {foo: i32, bar: i32};
893const test: Foo = Foo {foo: 1, bar: 0}
894"#####,
895 )
896}
897
898#[test]
899fn doctest_reorder_impl() {
900 check_doc_test(
901 "reorder_impl",
902 r#####"
903trait Foo {
904 fn a() {}
905 fn b() {}
906 fn c() {}
907}
908
909struct Bar;
910$0impl Foo for Bar {
911 fn b() {}
912 fn c() {}
913 fn a() {}
914}
915"#####,
916 r#####"
917trait Foo {
918 fn a() {}
919 fn b() {}
920 fn c() {}
921}
922
923struct Bar;
924impl Foo for Bar {
925 fn a() {}
926 fn b() {}
927 fn c() {}
928}
929"#####,
930 )
931}
932
933#[test]
934fn doctest_replace_derive_with_manual_impl() {
935 check_doc_test(
936 "replace_derive_with_manual_impl",
937 r#####"
938trait Debug { fn fmt(&self, f: &mut Formatter) -> Result<()>; }
939#[derive(Deb$0ug, Display)]
940struct S;
941"#####,
942 r#####"
943trait Debug { fn fmt(&self, f: &mut Formatter) -> Result<()>; }
944#[derive(Display)]
945struct S;
946
947impl Debug for S {
948 fn fmt(&self, f: &mut Formatter) -> Result<()> {
949 ${0:todo!()}
950 }
951}
952"#####,
953 )
954}
955
956#[test]
957fn doctest_replace_if_let_with_match() {
958 check_doc_test(
959 "replace_if_let_with_match",
960 r#####"
961enum Action { Move { distance: u32 }, Stop }
962
963fn handle(action: Action) {
964 $0if let Action::Move { distance } = action {
965 foo(distance)
966 } else {
967 bar()
968 }
969}
970"#####,
971 r#####"
972enum Action { Move { distance: u32 }, Stop }
973
974fn handle(action: Action) {
975 match action {
976 Action::Move { distance } => foo(distance),
977 _ => bar(),
978 }
979}
980"#####,
981 )
982}
983
984#[test]
985fn doctest_replace_impl_trait_with_generic() {
986 check_doc_test(
987 "replace_impl_trait_with_generic",
988 r#####"
989fn foo(bar: $0impl Bar) {}
990"#####,
991 r#####"
992fn foo<B: Bar>(bar: B) {}
993"#####,
994 )
995}
996
997#[test]
998fn doctest_replace_let_with_if_let() {
999 check_doc_test(
1000 "replace_let_with_if_let",
1001 r#####"
1002enum Option<T> { Some(T), None }
1003
1004fn main(action: Action) {
1005 $0let x = compute();
1006}
1007
1008fn compute() -> Option<i32> { None }
1009"#####,
1010 r#####"
1011enum Option<T> { Some(T), None }
1012
1013fn main(action: Action) {
1014 if let Some(x) = compute() {
1015 }
1016}
1017
1018fn compute() -> Option<i32> { None }
1019"#####,
1020 )
1021}
1022
1023#[test]
1024fn doctest_replace_match_with_if_let() {
1025 check_doc_test(
1026 "replace_match_with_if_let",
1027 r#####"
1028enum Action { Move { distance: u32 }, Stop }
1029
1030fn handle(action: Action) {
1031 $0match action {
1032 Action::Move { distance } => foo(distance),
1033 _ => bar(),
1034 }
1035}
1036"#####,
1037 r#####"
1038enum Action { Move { distance: u32 }, Stop }
1039
1040fn handle(action: Action) {
1041 if let Action::Move { distance } = action {
1042 foo(distance)
1043 } else {
1044 bar()
1045 }
1046}
1047"#####,
1048 )
1049}
1050
1051#[test]
1052fn doctest_replace_qualified_name_with_use() {
1053 check_doc_test(
1054 "replace_qualified_name_with_use",
1055 r#####"
1056fn process(map: std::collections::$0HashMap<String, String>) {}
1057"#####,
1058 r#####"
1059use std::collections::HashMap;
1060
1061fn process(map: HashMap<String, String>) {}
1062"#####,
1063 )
1064}
1065
1066#[test]
1067fn doctest_replace_string_with_char() {
1068 check_doc_test(
1069 "replace_string_with_char",
1070 r#####"
1071fn main() {
1072 find("{$0");
1073}
1074"#####,
1075 r#####"
1076fn main() {
1077 find('{');
1078}
1079"#####,
1080 )
1081}
1082
1083#[test]
1084fn doctest_replace_unwrap_with_match() {
1085 check_doc_test(
1086 "replace_unwrap_with_match",
1087 r#####"
1088enum Result<T, E> { Ok(T), Err(E) }
1089fn main() {
1090 let x: Result<i32, i32> = Result::Ok(92);
1091 let y = x.$0unwrap();
1092}
1093"#####,
1094 r#####"
1095enum Result<T, E> { Ok(T), Err(E) }
1096fn main() {
1097 let x: Result<i32, i32> = Result::Ok(92);
1098 let y = match x {
1099 Ok(a) => a,
1100 $0_ => unreachable!(),
1101 };
1102}
1103"#####,
1104 )
1105}
1106
1107#[test]
1108fn doctest_split_import() {
1109 check_doc_test(
1110 "split_import",
1111 r#####"
1112use std::$0collections::HashMap;
1113"#####,
1114 r#####"
1115use std::{collections::HashMap};
1116"#####,
1117 )
1118}
1119
1120#[test]
1121fn doctest_toggle_ignore() {
1122 check_doc_test(
1123 "toggle_ignore",
1124 r#####"
1125$0#[test]
1126fn arithmetics {
1127 assert_eq!(2 + 2, 5);
1128}
1129"#####,
1130 r#####"
1131#[test]
1132#[ignore]
1133fn arithmetics {
1134 assert_eq!(2 + 2, 5);
1135}
1136"#####,
1137 )
1138}
1139
1140#[test]
1141fn doctest_unmerge_use() {
1142 check_doc_test(
1143 "unmerge_use",
1144 r#####"
1145use std::fmt::{Debug, Display$0};
1146"#####,
1147 r#####"
1148use std::fmt::{Debug};
1149use std::fmt::Display;
1150"#####,
1151 )
1152}
1153
1154#[test]
1155fn doctest_unwrap_block() {
1156 check_doc_test(
1157 "unwrap_block",
1158 r#####"
1159fn foo() {
1160 if true {$0
1161 println!("foo");
1162 }
1163}
1164"#####,
1165 r#####"
1166fn foo() {
1167 println!("foo");
1168}
1169"#####,
1170 )
1171}
1172
1173#[test]
1174fn doctest_wrap_return_type_in_result() {
1175 check_doc_test(
1176 "wrap_return_type_in_result",
1177 r#####"
1178fn foo() -> i32$0 { 42i32 }
1179"#####,
1180 r#####"
1181fn foo() -> Result<i32, ${0:_}> { Ok(42i32) }
1182"#####,
1183 )
1184}