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()}
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), || []);
139 println!("dsfs"); // a comment
143 let hello = &format!(
144 "HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
145 "65454654654654654654654655464", "4"
151 (#[$attr:meta] $name:ident) => {};
166 b: types::Timestamptz,
175 init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
178 .par_map_inplace(|el| *el = 0.);
189 .collect::<Vec<_>>();
195 fn test(a: String, s: String, b: String) -> TestResult {
196 if a.find(&s).is_none() {
198 TestResult::from_bool(true)
200 TestResult::discard()
210 static ref ONE: u32 = 1;
211 static ref TWO: u32 = 2;
212 static ref THREE: u32 = 3;
213 static ref FOUR: u32 = {
231 let data = if let Some(debug) = error.debug_info() {
233 "errorKind": format!("{:?}", error.err_kind()),
234 "debugMessage": debug.message,
237 json!({ "errorKind": format!("{:?}", error.err_kind()) })
242 vbuf: gfx::VertexBuffer<Vertex> = (),
243 out: gfx::RenderTarget<ColorFormat> = "Target0",
248 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
250 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
253 "Size of template specialization: ",
254 stringify!(HandleWithDtor<::std::os::raw::c_int>)
258 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
261 "Alignment of template specialization: ",
262 stringify!(HandleWithDtor<::std::os::raw::c_int>)
268 macro_rules! try_opt {
281 // macro call whose argument is an array with trailing comma.
284 str_searcher_ascii_haystack,
297 fn special_case_macros() {
299 let q = eprint!("{}", 1);
301 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
302 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
305 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
334 let q = eprintln!("{}", 1);
336 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
337 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
340 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
369 let q = format!("{}", 1);
371 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
372 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
375 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
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
409 let s = format_args!(
410 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
439 let q = print!("{}", 1);
441 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
442 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
445 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
474 let q = println!("{}", 1);
476 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
477 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
480 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
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
514 let s = unreachable!(
515 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
546 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
547 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
550 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
581 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
582 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
585 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
616 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
617 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
620 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
651 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
652 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
655 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
686 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
687 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
690 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
720 assert!(result == 42);
721 assert!(result == 42, "Ahoy there, {}!", target);
724 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
731 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
762 assert_eq!(left, right);
763 assert_eq!(left, right, "Ahoy there, {}!", target);
766 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
767 result, input, expected
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 '{}')",
780 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
788 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
817 write!(&mut s, "Ahoy there, {}!", target);
820 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
821 result, input, expected
825 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
854 writeln!(&mut s, "Ahoy there, {}!", target);
857 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
858 result, input, expected
862 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
895 pub fn foo(&self) -> Bar<foo!()> {}
899 fn macro_in_pattern_position() {
903 bar!(a, b, c,) => (),
904 baz!(1 + 2 + 3, quux.kaas()) => (),
906 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
907 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
914 pub macro bar($x:ident + $y:expr;) {
917 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
936 macro lex_err($kind: ident $(, $body: expr)*) {
937 Err(QlError::LexError(LexError::$kind($($body,)*)))
940 // Preserve trailing comma on item-level macro with `()` or `[]`.
941 methods![get, post, delete,];
942 methods!(get, post, delete,);
962 _ => unreachable!(/* obviously */),
967 let _ = column!(/* here */);
971 // Preserve trailing comma when using mixed layout for macro call.
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
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,
984 // Preserve trailing comma-less/ness inside nested macro.
986 do_parse_gsv<GsvData>,
989 number_of_sentences: map_res!(digit, parse_num::<u16>)
991 >> sentence_index: map_res!(digit, parse_num::<u16>)
993 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
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))
1000 number_of_sentences,
1002 total_number_of_sats,
1014 convert_args!(vec!(1, 2, 3));
1018 /// TLV Holds a set of JSTraceables that need to be rooted
1019 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1023 /// TLV Holds a set of JSTraceables that need to be rooted
1024 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1026 /// TLV Holds a set of JSTraceables that need to be rooted
1027 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1028 RefCell::new(RootedTraceableSet::new(0));
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);
1034 /// TLV Holds a set of JSTraceables that need to be rooted
1035 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1036 RefCell::new(RootedTraceableSet::new(1234));
1045 pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
1047 extern_token: Token![extern](tokens_helper(_visitor, &_i.extern_token.span)),
1048 name: (_i.name).map(|it| _visitor.fold_lit_str(it)),