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), || []);
136 // Don't format empty either!
141 println!("dsfs"); // a comment
145 let hello = &format!(
146 "HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
147 "65454654654654654654654655464", "4"
153 (#[$attr:meta] $name:ident) => {};
168 b: types::Timestamptz,
177 init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
180 .par_map_inplace(|el| *el = 0.);
191 .collect::<Vec<_>>();
197 fn test(a: String, s: String, b: String) -> TestResult {
198 if a.find(&s).is_none() {
200 TestResult::from_bool(true)
202 TestResult::discard()
212 static ref ONE: u32 = 1;
213 static ref TWO: u32 = 2;
214 static ref THREE: u32 = 3;
215 static ref FOUR: u32 = {
233 let data = if let Some(debug) = error.debug_info() {
235 "errorKind": format!("{:?}", error.err_kind()),
236 "debugMessage": debug.message,
239 json!({ "errorKind": format!("{:?}", error.err_kind()) })
244 vbuf: gfx::VertexBuffer<Vertex> = (),
245 out: gfx::RenderTarget<ColorFormat> = "Target0",
250 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
252 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
255 "Size of template specialization: ",
256 stringify!(HandleWithDtor<::std::os::raw::c_int>)
260 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
263 "Alignment of template specialization: ",
264 stringify!(HandleWithDtor<::std::os::raw::c_int>)
270 macro_rules! try_opt {
283 // macro call whose argument is an array with trailing comma.
286 str_searcher_ascii_haystack,
299 fn special_case_macros() {
301 let q = eprint!("{}", 1);
303 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
304 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
307 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
336 let q = eprintln!("{}", 1);
338 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
339 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
342 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
371 let q = format!("{}", 1);
373 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
374 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
377 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
406 let q = format_args!("{}", 1);
407 let r = format_args!(
408 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
409 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
411 let s = format_args!(
412 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
441 let q = print!("{}", 1);
443 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
444 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
447 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
476 let q = println!("{}", 1);
478 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
479 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
482 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
511 let q = unreachable!("{}", 1);
512 let r = unreachable!(
513 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
514 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
516 let s = unreachable!(
517 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
548 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
549 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
552 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
583 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
584 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
587 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
618 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
619 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
622 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
653 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
654 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
657 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
688 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
689 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
692 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
722 assert!(result == 42);
723 assert!(result == 42, "Ahoy there, {}!", target);
726 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
733 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
764 assert_eq!(left, right);
765 assert_eq!(left, right, "Ahoy there, {}!", target);
768 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
769 result, input, expected
772 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
773 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
774 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
782 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
790 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
819 write!(&mut s, "Ahoy there, {}!", target);
822 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
823 result, input, expected
827 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
856 writeln!(&mut s, "Ahoy there, {}!", target);
859 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
860 result, input, expected
864 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
897 pub fn foo(&self) -> Bar<foo!()> {}
901 fn macro_in_pattern_position() {
905 bar!(a, b, c,) => (),
906 baz!(1 + 2 + 3, quux.kaas()) => (),
908 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
909 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
916 pub macro bar($x:ident + $y:expr;) {
919 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
938 macro lex_err($kind: ident $(, $body: expr)*) {
939 Err(QlError::LexError(LexError::$kind($($body,)*)))
942 // Preserve trailing comma on item-level macro with `()` or `[]`.
943 methods![get, post, delete,];
944 methods!(get, post, delete,);
964 _ => unreachable!(/* obviously */),
969 let _ = column!(/* here */);
973 // Preserve trailing comma when using mixed layout for macro call.
976 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
980 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,
981 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,
986 // Preserve trailing comma inside macro, even if it looks an array.
989 $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]);
994 // Preserve trailing comma-less/ness inside nested macro.
996 do_parse_gsv<GsvData>,
999 number_of_sentences: map_res!(digit, parse_num::<u16>)
1001 >> sentence_index: map_res!(digit, parse_num::<u16>)
1003 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
1005 >> sat0: opt!(complete!(parse_gsv_sat_info))
1006 >> sat1: opt!(complete!(parse_gsv_sat_info))
1007 >> sat2: opt!(complete!(parse_gsv_sat_info))
1008 >> sat3: opt!(complete!(parse_gsv_sat_info))
1010 number_of_sentences,
1012 total_number_of_sats,
1024 convert_args!(vec!(1, 2, 3));
1028 /// TLV Holds a set of JSTraceables that need to be rooted
1029 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> = RefCell::new(RootedTraceableSet::new());
1036 /// TLV Holds a set of JSTraceables that need to be rooted
1037 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1038 RefCell::new(RootedTraceableSet::new(0));
1040 /// TLV Holds a set of JSTraceables that need to be rooted
1041 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1042 RefCell::new(RootedTraceableSet::new(), xxx, yyy);
1044 /// TLV Holds a set of JSTraceables that need to be rooted
1045 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1046 RefCell::new(RootedTraceableSet::new(1234));