1 // rustfmt-normalize_comments: true
2 // rustfmt-format_macro_matchers: true
3 itemmacro!(this, is.now().formatted(yay));
7 long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
12 itemmacro!{this, is.bracket().formatted()}
14 peg_file! modname("mygrammarfile.rustpeg");
25 baz!(1 + 2 + 3, quux.kaas());
28 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
29 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
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),
44 noexpr!( i am not an expression, OK? );
67 vec![a /* comment */];
69 // Trailing spaces after a comma
89 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
91 vec![a; unsafe { x + 1 }];
93 unknown_bracket_macro__comma_should_not_be_stripped![a,];
99 macrowithbraces! {dont, format, me}
121 let image = gray_image!(
127 chain!(input, a: take!(max_size), || []);
138 println!("dsfs"); // a comment
142 let hello = &format!(
143 "HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
144 "65454654654654654654654655464", "4"
150 (#[$attr:meta] $name:ident) => {};
165 b: types::Timestamptz,
174 init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
177 .par_map_inplace(|el| *el = 0.);
188 .collect::<Vec<_>>();
194 fn test(a: String, s: String, b: String) -> TestResult {
195 if a.find(&s).is_none() {
197 TestResult::from_bool(true)
199 TestResult::discard()
209 static ref ONE: u32 = 1;
210 static ref TWO: u32 = 2;
211 static ref THREE: u32 = 3;
212 static ref FOUR: u32 = {
230 let data = if let Some(debug) = error.debug_info() {
232 "errorKind": format!("{:?}", error.err_kind()),
233 "debugMessage": debug.message,
236 json!({ "errorKind": format!("{:?}", error.err_kind()) })
241 vbuf: gfx::VertexBuffer<Vertex> = (),
242 out: gfx::RenderTarget<ColorFormat> = "Target0",
247 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
249 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
252 "Size of template specialization: ",
253 stringify!(HandleWithDtor<::std::os::raw::c_int>)
257 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
260 "Alignment of template specialization: ",
261 stringify!(HandleWithDtor<::std::os::raw::c_int>)
267 macro_rules! try_opt {
280 // macro call whose argument is an array with trailing comma.
283 str_searcher_ascii_haystack,
296 fn special_case_macros() {
298 let q = eprint!("{}", 1);
300 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
301 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
304 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
333 let q = eprintln!("{}", 1);
335 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
336 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
339 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
368 let q = format!("{}", 1);
370 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
371 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
374 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
403 let q = format_args!("{}", 1);
404 let r = format_args!(
405 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
406 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
408 let s = format_args!(
409 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
438 let q = print!("{}", 1);
440 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
441 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
444 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
473 let q = println!("{}", 1);
475 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
476 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
479 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
508 let q = unreachable!("{}", 1);
509 let r = unreachable!(
510 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
511 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
513 let s = unreachable!(
514 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
545 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
546 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
549 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
580 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
581 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
584 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
615 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
616 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
619 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
650 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
651 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
654 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
685 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
686 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
689 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
719 assert!(result == 42);
720 assert!(result == 42, "Ahoy there, {}!", target);
723 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
730 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
761 assert_eq!(left, right);
762 assert_eq!(left, right, "Ahoy there, {}!", target);
765 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
766 result, input, expected
769 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
770 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
771 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
779 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
787 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
816 write!(&mut s, "Ahoy there, {}!", target);
819 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
820 result, input, expected
824 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
853 writeln!(&mut s, "Ahoy there, {}!", target);
856 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
857 result, input, expected
861 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
894 pub fn foo(&self) -> Bar<foo!()> {}
898 fn macro_in_pattern_position() {
902 bar!(a, b, c,) => (),
903 baz!(1 + 2 + 3, quux.kaas()) => (),
905 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
906 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
913 pub macro bar($x:ident + $y:expr;) {
916 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
935 macro lex_err($kind: ident $(, $body: expr)*) {
936 Err(QlError::LexError(LexError::$kind($($body,)*)))
939 // Preserve trailing comma on item-level macro with `()` or `[]`.
940 methods![get, post, delete,];
941 methods!(get, post, delete,);
961 _ => unreachable!(/* obviously */),
966 let _ = column!(/* here */);
970 // Preserve trailing comma when using mixed layout for macro call.
973 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,
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
977 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,
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,
983 // Preserve trailing comma inside macro, even if it looks an array.
986 $m!([a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]);
991 // Preserve trailing comma-less/ness inside nested macro.
993 do_parse_gsv<GsvData>,
996 number_of_sentences: map_res!(digit, parse_num::<u16>)
998 >> sentence_index: map_res!(digit, parse_num::<u16>)
1000 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
1002 >> sat0: opt!(complete!(parse_gsv_sat_info))
1003 >> sat1: opt!(complete!(parse_gsv_sat_info))
1004 >> sat2: opt!(complete!(parse_gsv_sat_info))
1005 >> sat3: opt!(complete!(parse_gsv_sat_info))
1007 number_of_sentences,
1009 total_number_of_sats,
1021 convert_args!(vec!(1, 2, 3));
1025 /// TLV Holds a set of JSTraceables that need to be rooted
1026 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1030 /// TLV Holds a set of JSTraceables that need to be rooted
1031 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1033 /// TLV Holds a set of JSTraceables that need to be rooted
1034 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1035 RefCell::new(RootedTraceableSet::new(0));
1037 /// TLV Holds a set of JSTraceables that need to be rooted
1038 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1039 RefCell::new(RootedTraceableSet::new(), xxx, yyy);
1041 /// TLV Holds a set of JSTraceables that need to be rooted
1042 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1043 RefCell::new(RootedTraceableSet::new(1234));