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 = {
229 vbuf: gfx::VertexBuffer<Vertex> = (),
230 out: gfx::RenderTarget<ColorFormat> = "Target0",
235 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
237 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
240 "Size of template specialization: ",
241 stringify!(HandleWithDtor<::std::os::raw::c_int>)
245 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
248 "Alignment of template specialization: ",
249 stringify!(HandleWithDtor<::std::os::raw::c_int>)
255 macro_rules! try_opt {
268 // macro call whose argument is an array with trailing comma.
271 str_searcher_ascii_haystack,
284 fn special_case_macros() {
286 let q = eprint!("{}", 1);
288 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
289 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
292 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
321 let q = eprintln!("{}", 1);
323 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
324 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
327 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
356 let q = format!("{}", 1);
358 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
359 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
362 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
391 let q = format_args!("{}", 1);
392 let r = format_args!(
393 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
394 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
396 let s = format_args!(
397 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
426 let q = print!("{}", 1);
428 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
429 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
432 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
461 let q = println!("{}", 1);
463 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
464 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
467 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
496 let q = unreachable!("{}", 1);
497 let r = unreachable!(
498 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
499 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
501 let s = unreachable!(
502 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
533 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
534 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
537 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
568 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
569 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
572 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
603 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
604 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
607 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
638 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
639 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
642 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
673 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
674 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
677 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
707 assert!(result == 42);
708 assert!(result == 42, "Ahoy there, {}!", target);
711 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
718 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
749 assert_eq!(left, right);
750 assert_eq!(left, right, "Ahoy there, {}!", target);
753 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
754 result, input, expected
757 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
758 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
759 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
767 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
775 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
804 write!(&mut s, "Ahoy there, {}!", target);
807 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
808 result, input, expected
812 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
841 writeln!(&mut s, "Ahoy there, {}!", target);
844 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
845 result, input, expected
849 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
882 pub fn foo(&self) -> Bar<foo!()> {}
886 fn macro_in_pattern_position() {
890 bar!(a, b, c,) => (),
891 baz!(1 + 2 + 3, quux.kaas()) => (),
893 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
894 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
901 pub macro bar($x:ident + $y:expr;) {
904 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
923 macro lex_err($kind: ident $(, $body: expr)*) {
924 Err(QlError::LexError(LexError::$kind($($body,)*)))
927 // Preserve trailing comma on item-level macro with `()` or `[]`.
928 methods![get, post, delete,];
929 methods!(get, post, delete,);
949 _ => unreachable!(/* obviously */),
954 let _ = column!(/* here */);
958 // Preserve trailing comma when using mixed layout for macro call.
961 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,
962 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
965 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,
966 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,
971 // Preserve trailing comma inside macro, even if it looks an array.
974 $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]);
979 // Preserve trailing comma-less/ness inside nested macro.
981 do_parse_gsv<GsvData>,
984 number_of_sentences: map_res!(digit, parse_num::<u16>)
986 >> sentence_index: map_res!(digit, parse_num::<u16>)
988 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
990 >> sat0: opt!(complete!(parse_gsv_sat_info))
991 >> sat1: opt!(complete!(parse_gsv_sat_info))
992 >> sat2: opt!(complete!(parse_gsv_sat_info))
993 >> sat3: opt!(complete!(parse_gsv_sat_info))
997 total_number_of_sats,
1009 convert_args!(vec!(1, 2, 3));
1013 /// TLV Holds a set of JSTraceables that need to be rooted
1014 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
1018 /// TLV Holds a set of JSTraceables that need to be rooted
1019 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> =
1023 RefCell::new(RootedTraceableSet::new(0));
1025 /// TLV Holds a set of JSTraceables that need to be rooted
1026 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1027 RefCell::new(RootedTraceableSet::new(), xxx, yyy);
1029 /// TLV Holds a set of JSTraceables that need to be rooted
1030 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
1031 RefCell::new(RootedTraceableSet::new(1234));