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.brace().formatted()}
23 baz!(1 + 2 + 3, quux.kaas());
26 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
27 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
36 trailingcomma!(a, b, c,);
37 // Preserve trailing comma only when necessary.
38 ok!(file.seek(SeekFrom::Start(
39 table.map(|table| fixture.offset(table)).unwrap_or(0),
42 noexpr!( i am not an expression, OK? );
65 vec![a /* comment */];
67 // Trailing spaces after a comma
87 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
89 vec![a; unsafe { x + 1 }];
91 unknown_bracket_macro__comma_should_not_be_stripped![a,];
97 macrowithbraces! {dont, format, me}
119 let image = gray_image!(
125 chain!(input, a: take!(max_size), || []);
137 println!("dsfs"); // a comment
141 let hello = &format!(
142 "HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
143 "65454654654654654654654655464", "4"
149 (#[$attr:meta] $name:ident) => {};
164 b: types::Timestamptz,
173 init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
176 .par_map_inplace(|el| *el = 0.);
187 .collect::<Vec<_>>();
193 fn test(a: String, s: String, b: String) -> TestResult {
194 if a.find(&s).is_none() {
196 TestResult::from_bool(true)
198 TestResult::discard()
208 static ref ONE: u32 = 1;
209 static ref TWO: u32 = 2;
210 static ref THREE: u32 = 3;
211 static ref FOUR: u32 = {
229 let data = if let Some(debug) = error.debug_info() {
231 "errorKind": format!("{:?}", error.err_kind()),
232 "debugMessage": debug.message,
235 json!({ "errorKind": format!("{:?}", error.err_kind()) })
240 vbuf: gfx::VertexBuffer<Vertex> = (),
241 out: gfx::RenderTarget<ColorFormat> = "Target0",
246 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
248 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
251 "Size of template specialization: ",
252 stringify!(HandleWithDtor<::std::os::raw::c_int>)
256 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
259 "Alignment of template specialization: ",
260 stringify!(HandleWithDtor<::std::os::raw::c_int>)
266 macro_rules! try_opt {
279 // macro call whose argument is an array with trailing comma.
282 str_searcher_ascii_haystack,
295 fn special_case_macros() {
297 let q = eprint!("{}", 1);
299 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
300 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
303 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
332 let q = eprintln!("{}", 1);
334 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
335 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
338 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
367 let q = format!("{}", 1);
369 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
370 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
373 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
402 let q = format_args!("{}", 1);
403 let r = format_args!(
404 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
405 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
407 let s = format_args!(
408 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
437 let q = print!("{}", 1);
439 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
440 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
443 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
472 let q = println!("{}", 1);
474 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
475 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
478 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
507 let q = unreachable!("{}", 1);
508 let r = unreachable!(
509 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
510 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
512 let s = unreachable!(
513 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
544 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
545 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
548 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
579 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
580 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
583 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
614 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
615 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
618 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
649 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
650 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
653 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
684 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
685 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
688 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
718 assert!(result == 42);
719 assert!(result == 42, "Ahoy there, {}!", target);
722 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
729 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
760 assert_eq!(left, right);
761 assert_eq!(left, right, "Ahoy there, {}!", target);
764 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
765 result, input, expected
768 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
769 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
770 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
778 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
786 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
815 write!(&mut s, "Ahoy there, {}!", target);
818 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
819 result, input, expected
823 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
852 writeln!(&mut s, "Ahoy there, {}!", target);
855 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
856 result, input, expected
860 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
893 pub fn foo(&self) -> Bar<foo!()> {}
897 fn macro_in_pattern_position() {
901 bar!(a, b, c,) => (),
902 baz!(1 + 2 + 3, quux.kaas()) => (),
904 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
905 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
912 pub macro bar($x:ident + $y:expr;) {
915 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
934 macro lex_err($kind: ident $(, $body: expr)*) {
935 Err(QlError::LexError(LexError::$kind($($body,)*)))
938 // Preserve trailing comma on item-level macro with `()` or `[]`.
939 methods![get, post, delete,];
940 methods!(get, post, delete,);
960 _ => unreachable!(/* obviously */),
965 let _ = column!(/* here */);
969 // Preserve trailing comma when using mixed layout for macro call.
972 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,
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
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,
982 // Preserve trailing comma-less/ness inside nested macro.
984 do_parse_gsv<GsvData>,
987 number_of_sentences: map_res!(digit, parse_num::<u16>)
989 >> sentence_index: map_res!(digit, parse_num::<u16>)
991 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
993 >> sat0: opt!(complete!(parse_gsv_sat_info))
994 >> sat1: opt!(complete!(parse_gsv_sat_info))
995 >> sat2: opt!(complete!(parse_gsv_sat_info))
996 >> sat3: opt!(complete!(parse_gsv_sat_info))
1000 total_number_of_sats,
1012 convert_args!(vec!(1, 2, 3));
1016 /// TLV Holds a set of JSTraceables that need to be rooted
1017 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1021 /// TLV Holds a set of JSTraceables that need to be rooted
1022 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1024 /// TLV Holds a set of JSTraceables that need to be rooted
1025 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1026 RefCell::new(RootedTraceableSet::new(0));
1028 /// TLV Holds a set of JSTraceables that need to be rooted
1029 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1030 RefCell::new(RootedTraceableSet::new(), xxx, yyy);
1032 /// TLV Holds a set of JSTraceables that need to be rooted
1033 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1034 RefCell::new(RootedTraceableSet::new(1234));
1043 pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
1045 extern_token: Token![extern](tokens_helper(_visitor, &_i.extern_token.span)),
1046 name: (_i.name).map(|it| _visitor.fold_lit_str(it)),
1056 (3, false), // Missing
1057 (4, true) // I-frame