]> git.lizzy.rs Git - rust.git/blob - tests/target/macros.rs
8f86b79f9225e8870fc7c1632ed03464fd1da5c1
[rust.git] / tests / target / macros.rs
1 // rustfmt-normalize_comments: true
2 // rustfmt-format_macro_matchers: true
3 itemmacro!(this, is.now().formatted(yay));
4
5 itemmacro!(
6     really,
7     long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
8         .is
9         .formatted()
10 );
11
12 itemmacro! {this, is.brace().formatted()}
13
14 peg_file! modname("mygrammarfile.rustpeg");
15
16 fn main() {
17     foo!();
18
19     foo!(,);
20
21     bar!(a, b, c);
22
23     bar!(a, b, c,);
24
25     baz!(1 + 2 + 3, quux.kaas());
26
27     quux!(
28         AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
29         BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
30     );
31
32     kaas!(
33         // comments
34         a, // post macro
35         b  // another
36     );
37
38     trailingcomma!(a, b, c,);
39     // Preserve trailing comma only when necessary.
40     ok!(file.seek(SeekFrom::Start(
41         table.map(|table| fixture.offset(table)).unwrap_or(0),
42     )));
43
44     noexpr!( i am not an expression, OK? );
45
46     vec![a, b, c];
47
48     vec![
49         AAAAAA,
50         AAAAAA,
51         AAAAAA,
52         AAAAAA,
53         AAAAAA,
54         AAAAAA,
55         AAAAAA,
56         AAAAAA,
57         AAAAAA,
58         BBBBB,
59         5,
60         100 - 30,
61         1.33,
62         b,
63         b,
64         b,
65     ];
66
67     vec![a /* comment */];
68
69     // Trailing spaces after a comma
70     vec![a];
71
72     vec![a; b];
73     vec![a; b];
74     vec![a; b];
75
76     vec![a, b; c];
77     vec![a; b, c];
78
79     vec![
80         a;
81         (|x| {
82             let y = x + 1;
83             let z = y + 1;
84             z
85         })(2)
86     ];
87     vec![
88         a;
89         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
90     ];
91     vec![a; unsafe { x + 1 }];
92
93     unknown_bracket_macro__comma_should_not_be_stripped![a,];
94
95     foo(makro!(1, 3));
96
97     hamkaas! { () };
98
99     macrowithbraces! {dont,    format, me}
100
101     x!(fn);
102
103     some_macro!();
104
105     some_macro![];
106
107     some_macro! {
108         // comment
109     };
110
111     some_macro! {
112         // comment
113     };
114
115     some_macro!(
116         // comment
117         not function like
118     );
119
120     // #1712
121     let image = gray_image!(
122         00, 01, 02;
123         10, 11, 12;
124         20, 21, 22);
125
126     // #1092
127     chain!(input, a: take!(max_size), || []);
128
129     // #2727
130     foo!("bar");
131 }
132
133 impl X {
134     empty_invoc! {}
135     empty_invoc! {}
136 }
137
138 fn issue_1279() {
139     println!("dsfs"); // a comment
140 }
141
142 fn issue_1555() {
143     let hello = &format!(
144         "HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
145         "65454654654654654654654655464", "4"
146     );
147 }
148
149 fn issue1178() {
150     macro_rules! foo {
151         (#[$attr:meta] $name:ident) => {};
152     }
153
154     foo!(
155         #[doc = "bar"]
156         baz
157     );
158 }
159
160 fn issue1739() {
161     sql_function!(
162         add_rss_item,
163         add_rss_item_t,
164         (
165             a: types::Integer,
166             b: types::Timestamptz,
167             c: types::Text,
168             d: types::Text,
169             e: types::Text
170         )
171     );
172
173     w.slice_mut(s![
174         ..,
175         init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
176         ..
177     ])
178     .par_map_inplace(|el| *el = 0.);
179 }
180
181 fn issue_1885() {
182     let threads = people
183         .into_iter()
184         .map(|name| {
185             chan_select! {
186                 rx.recv() => {}
187             }
188         })
189         .collect::<Vec<_>>();
190 }
191
192 fn issue_1917() {
193     mod x {
194         quickcheck! {
195             fn test(a: String, s: String, b: String) -> TestResult {
196                 if a.find(&s).is_none() {
197
198                     TestResult::from_bool(true)
199                 } else {
200                     TestResult::discard()
201                 }
202             }
203         }
204     }
205 }
206
207 fn issue_1921() {
208     // Macro with tabs.
209     lazy_static! {
210         static ref ONE: u32 = 1;
211         static ref TWO: u32 = 2;
212         static ref THREE: u32 = 3;
213         static ref FOUR: u32 = {
214             let mut acc = 1;
215             acc += 1;
216             acc += 2;
217             acc
218         };
219     }
220 }
221
222 // #1577
223 fn issue1577() {
224     let json = json!({
225         "foo": "bar",
226     });
227 }
228
229 // #3174
230 fn issue_3174() {
231     let data = if let Some(debug) = error.debug_info() {
232         json!({
233             "errorKind": format!("{:?}", error.err_kind()),
234             "debugMessage": debug.message,
235         })
236     } else {
237         json!({ "errorKind": format!("{:?}", error.err_kind()) })
238     };
239 }
240
241 gfx_pipeline!(pipe {
242     vbuf: gfx::VertexBuffer<Vertex> = (),
243     out: gfx::RenderTarget<ColorFormat> = "Target0",
244 });
245
246 // #1919
247 #[test]
248 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
249     assert_eq!(
250         ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
251         8usize,
252         concat!(
253             "Size of template specialization: ",
254             stringify!(HandleWithDtor<::std::os::raw::c_int>)
255         )
256     );
257     assert_eq!(
258         ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
259         8usize,
260         concat!(
261             "Alignment of template specialization: ",
262             stringify!(HandleWithDtor<::std::os::raw::c_int>)
263         )
264     );
265 }
266
267 // #878
268 macro_rules! try_opt {
269     ($expr:expr) => {
270         match $expr {
271             Some(val) => val,
272
273             None => {
274                 return None;
275             }
276         }
277     };
278 }
279
280 // #2214
281 // macro call whose argument is an array with trailing comma.
282 fn issue2214() {
283     make_test!(
284         str_searcher_ascii_haystack,
285         "bb",
286         "abbcbbd",
287         [
288             Reject(0, 1),
289             Match(1, 3),
290             Reject(3, 4),
291             Match(4, 6),
292             Reject(6, 7),
293         ]
294     );
295 }
296
297 fn special_case_macros() {
298     let p = eprint!();
299     let q = eprint!("{}", 1);
300     let r = eprint!(
301         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
302         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
303     );
304     let s = eprint!(
305         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
306         1,
307         2,
308         3,
309         4,
310         5,
311         6,
312         7,
313         8,
314         9,
315         10,
316         11,
317         12,
318         13,
319         14,
320         15,
321         16,
322         17,
323         18,
324         19,
325         20,
326         21,
327         22,
328         23,
329         24,
330         25,
331         26
332     );
333
334     let q = eprintln!("{}", 1);
335     let r = eprintln!(
336         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
337         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
338     );
339     let s = eprintln!(
340         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
341         1,
342         2,
343         3,
344         4,
345         5,
346         6,
347         7,
348         8,
349         9,
350         10,
351         11,
352         12,
353         13,
354         14,
355         15,
356         16,
357         17,
358         18,
359         19,
360         20,
361         21,
362         22,
363         23,
364         24,
365         25,
366         26
367     );
368
369     let q = format!("{}", 1);
370     let r = format!(
371         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
372         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
373     );
374     let s = format!(
375         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
376         1,
377         2,
378         3,
379         4,
380         5,
381         6,
382         7,
383         8,
384         9,
385         10,
386         11,
387         12,
388         13,
389         14,
390         15,
391         16,
392         17,
393         18,
394         19,
395         20,
396         21,
397         22,
398         23,
399         24,
400         25,
401         26
402     );
403
404     let q = format_args!("{}", 1);
405     let r = format_args!(
406         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
407         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
408     );
409     let s = format_args!(
410         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
411         1,
412         2,
413         3,
414         4,
415         5,
416         6,
417         7,
418         8,
419         9,
420         10,
421         11,
422         12,
423         13,
424         14,
425         15,
426         16,
427         17,
428         18,
429         19,
430         20,
431         21,
432         22,
433         23,
434         24,
435         25,
436         26
437     );
438
439     let q = print!("{}", 1);
440     let r = print!(
441         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
442         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
443     );
444     let s = print!(
445         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
446         1,
447         2,
448         3,
449         4,
450         5,
451         6,
452         7,
453         8,
454         9,
455         10,
456         11,
457         12,
458         13,
459         14,
460         15,
461         16,
462         17,
463         18,
464         19,
465         20,
466         21,
467         22,
468         23,
469         24,
470         25,
471         26
472     );
473
474     let q = println!("{}", 1);
475     let r = println!(
476         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
477         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
478     );
479     let s = println!(
480         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
481         1,
482         2,
483         3,
484         4,
485         5,
486         6,
487         7,
488         8,
489         9,
490         10,
491         11,
492         12,
493         13,
494         14,
495         15,
496         16,
497         17,
498         18,
499         19,
500         20,
501         21,
502         22,
503         23,
504         24,
505         25,
506         26
507     );
508
509     let q = unreachable!("{}", 1);
510     let r = unreachable!(
511         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
512         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
513     );
514     let s = unreachable!(
515         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
516         1,
517         2,
518         3,
519         4,
520         5,
521         6,
522         7,
523         8,
524         9,
525         10,
526         11,
527         12,
528         13,
529         14,
530         15,
531         16,
532         17,
533         18,
534         19,
535         20,
536         21,
537         22,
538         23,
539         24,
540         25,
541         26
542     );
543
544     debug!("{}", 1);
545     debug!(
546         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
547         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
548     );
549     debug!(
550         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
551         1,
552         2,
553         3,
554         4,
555         5,
556         6,
557         7,
558         8,
559         9,
560         10,
561         11,
562         12,
563         13,
564         14,
565         15,
566         16,
567         17,
568         18,
569         19,
570         20,
571         21,
572         22,
573         23,
574         24,
575         25,
576         26
577     );
578
579     error!("{}", 1);
580     error!(
581         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
582         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
583     );
584     error!(
585         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
586         1,
587         2,
588         3,
589         4,
590         5,
591         6,
592         7,
593         8,
594         9,
595         10,
596         11,
597         12,
598         13,
599         14,
600         15,
601         16,
602         17,
603         18,
604         19,
605         20,
606         21,
607         22,
608         23,
609         24,
610         25,
611         26
612     );
613
614     info!("{}", 1);
615     info!(
616         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
617         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
618     );
619     info!(
620         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
621         1,
622         2,
623         3,
624         4,
625         5,
626         6,
627         7,
628         8,
629         9,
630         10,
631         11,
632         12,
633         13,
634         14,
635         15,
636         16,
637         17,
638         18,
639         19,
640         20,
641         21,
642         22,
643         23,
644         24,
645         25,
646         26
647     );
648
649     panic!("{}", 1);
650     panic!(
651         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
652         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
653     );
654     panic!(
655         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
656         1,
657         2,
658         3,
659         4,
660         5,
661         6,
662         7,
663         8,
664         9,
665         10,
666         11,
667         12,
668         13,
669         14,
670         15,
671         16,
672         17,
673         18,
674         19,
675         20,
676         21,
677         22,
678         23,
679         24,
680         25,
681         26
682     );
683
684     warn!("{}", 1);
685     warn!(
686         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
687         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
688     );
689     warn!(
690         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
691         1,
692         2,
693         3,
694         4,
695         5,
696         6,
697         7,
698         8,
699         9,
700         10,
701         11,
702         12,
703         13,
704         14,
705         15,
706         16,
707         17,
708         18,
709         19,
710         20,
711         21,
712         22,
713         23,
714         24,
715         25,
716         26
717     );
718
719     assert!();
720     assert!(result == 42);
721     assert!(result == 42, "Ahoy there, {}!", target);
722     assert!(
723         result == 42,
724         "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
725         result,
726         input,
727         expected
728     );
729     assert!(
730         result == 42,
731         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
732         1,
733         2,
734         3,
735         4,
736         5,
737         6,
738         7,
739         8,
740         9,
741         10,
742         11,
743         12,
744         13,
745         14,
746         15,
747         16,
748         17,
749         18,
750         19,
751         20,
752         21,
753         22,
754         23,
755         24,
756         25,
757         26
758     );
759
760     assert_eq!();
761     assert_eq!(left);
762     assert_eq!(left, right);
763     assert_eq!(left, right, "Ahoy there, {}!", target);
764     assert_eq!(
765         left, right,
766         "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
767         result, input, expected
768     );
769     assert_eq!(
770         first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
771         second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
772         "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
773         result,
774         input,
775         expected
776     );
777     assert_eq!(
778         left + 42,
779         right,
780         "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
781         result,
782         input,
783         expected
784     );
785     assert_eq!(
786         left,
787         right,
788         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
789         1,
790         2,
791         3,
792         4,
793         5,
794         6,
795         7,
796         8,
797         9,
798         10,
799         11,
800         12,
801         13,
802         14,
803         15,
804         16,
805         17,
806         18,
807         19,
808         20,
809         21,
810         22,
811         23,
812         24,
813         25,
814         26
815     );
816
817     write!(&mut s, "Ahoy there, {}!", target);
818     write!(
819         &mut s,
820         "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
821         result, input, expected
822     );
823     write!(
824         &mut s,
825         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
826         1,
827         2,
828         3,
829         4,
830         5,
831         6,
832         7,
833         8,
834         9,
835         10,
836         11,
837         12,
838         13,
839         14,
840         15,
841         16,
842         17,
843         18,
844         19,
845         20,
846         21,
847         22,
848         23,
849         24,
850         25,
851         26
852     );
853
854     writeln!(&mut s, "Ahoy there, {}!", target);
855     writeln!(
856         &mut s,
857         "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
858         result, input, expected
859     );
860     writeln!(
861         &mut s,
862         "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
863         1,
864         2,
865         3,
866         4,
867         5,
868         6,
869         7,
870         8,
871         9,
872         10,
873         11,
874         12,
875         13,
876         14,
877         15,
878         16,
879         17,
880         18,
881         19,
882         20,
883         21,
884         22,
885         23,
886         24,
887         25,
888         26
889     );
890 }
891
892 // #1209
893 impl Foo {
894     /// foo
895     pub fn foo(&self) -> Bar<foo!()> {}
896 }
897
898 // #819
899 fn macro_in_pattern_position() {
900     let x = match y {
901         foo!() => (),
902         bar!(a, b, c) => (),
903         bar!(a, b, c,) => (),
904         baz!(1 + 2 + 3, quux.kaas()) => (),
905         quux!(
906             AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
907             BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
908         ) => (),
909     };
910 }
911
912 macro foo() {}
913
914 pub macro bar($x:ident + $y:expr;) {
915     fn foo($x: Foo) {
916         long_function(
917             a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
918             $x.bar($y),
919         );
920     }
921 }
922
923 macro foo() {
924     // a comment
925     fn foo() {
926         // another comment
927         bar();
928     }
929 }
930
931 // #2574
932 macro_rules! test {
933     () => {{}};
934 }
935
936 macro lex_err($kind: ident $(, $body: expr)*) {
937     Err(QlError::LexError(LexError::$kind($($body,)*)))
938 }
939
940 // Preserve trailing comma on item-level macro with `()` or `[]`.
941 methods![get, post, delete,];
942 methods!(get, post, delete,);
943
944 // #2588
945 macro_rules! m {
946     () => {
947         r#"
948             test
949         "#
950     };
951 }
952 fn foo() {
953     f! {r#"
954             test
955        "#};
956 }
957
958 // #2591
959 fn foo() {
960     match 0u32 {
961         0 => (),
962         _ => unreachable!(/* obviously */),
963     }
964 }
965
966 fn foo() {
967     let _ = column!(/* here */);
968 }
969
970 // #2616
971 // Preserve trailing comma when using mixed layout for macro call.
972 fn foo() {
973     foo!(
974         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
975         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
976     );
977     foo!(
978         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
979         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
980     );
981 }
982
983 // #2830
984 // Preserve trailing comma-less/ness inside nested macro.
985 named!(
986     do_parse_gsv<GsvData>,
987     map_res!(
988         do_parse!(
989             number_of_sentences: map_res!(digit, parse_num::<u16>)
990                 >> char!(',')
991                 >> sentence_index: map_res!(digit, parse_num::<u16>)
992                 >> char!(',')
993                 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
994                 >> char!(',')
995                 >> sat0: opt!(complete!(parse_gsv_sat_info))
996                 >> sat1: opt!(complete!(parse_gsv_sat_info))
997                 >> sat2: opt!(complete!(parse_gsv_sat_info))
998                 >> sat3: opt!(complete!(parse_gsv_sat_info))
999                 >> (
1000                     number_of_sentences,
1001                     sentence_index,
1002                     total_number_of_sats,
1003                     sat0,
1004                     sat1,
1005                     sat2,
1006                     sat3
1007                 )
1008         ),
1009         construct_gsv_data
1010     )
1011 );
1012
1013 // #2857
1014 convert_args!(vec!(1, 2, 3));
1015
1016 // #3031
1017 thread_local!(
1018     /// TLV Holds a set of JSTraceables that need to be rooted
1019     static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1020 );
1021
1022 thread_local![
1023     /// TLV Holds a set of JSTraceables that need to be rooted
1024     static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1025
1026     /// TLV Holds a set of JSTraceables that need to be rooted
1027     static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1028         RefCell::new(RootedTraceableSet::new(0));
1029
1030     /// TLV Holds a set of JSTraceables that need to be rooted
1031     static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1032         RefCell::new(RootedTraceableSet::new(), xxx, yyy);
1033
1034     /// TLV Holds a set of JSTraceables that need to be rooted
1035     static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1036         RefCell::new(RootedTraceableSet::new(1234));
1037 ];
1038
1039 fn issue3004() {
1040     foo!(|_| { () });
1041     stringify!((foo+));
1042 }
1043
1044 // #3331
1045 pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
1046     Abi {
1047         extern_token: Token![extern](tokens_helper(_visitor, &_i.extern_token.span)),
1048         name: (_i.name).map(|it| _visitor.fold_lit_str(it)),
1049     }
1050 }
1051
1052 // #3463
1053 x! {()}
1054 x! y {()}