1 // rustfmt-normalize_comments: true
2 itemmacro!(this, is.now().formatted(yay));
6 long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
11 itemmacro!{this, is.bracket().formatted()}
13 peg_file! modname("mygrammarfile.rustpeg");
22 baz!(1 + 2 + 3, quux.kaas());
25 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
26 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
35 trailingcomma!(a, b, c,);
36 // Preserve trailing comma only when necessary.
37 ok!(file.seek(SeekFrom::Start(
38 table.map(|table| fixture.offset(table)).unwrap_or(0),
41 noexpr!( i am not an expression, OK? );
64 vec![a /* comment */];
66 // Trailing spaces after a comma
86 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
88 vec![a; unsafe { x + 1 }];
90 unknown_bracket_macro__comma_should_not_be_stripped![a,];
96 macrowithbraces! {dont, format, me}
118 let image = gray_image!(
124 chain!(input, a: take!(max_size), || []);
132 println!("dsfs"); // a comment
136 let hello = &format!(
137 "HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
138 "65454654654654654654654655464", "4"
144 (#[$attr: meta] $name: ident) => {};
159 b: types::Timestamptz,
168 init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
170 ]).par_map_inplace(|el| *el = 0.);
181 .collect::<Vec<_>>();
187 fn test(a: String, s: String, b: String) -> TestResult {
188 if a.find(&s).is_none() {
190 TestResult::from_bool(true)
192 TestResult::discard()
202 static ref ONE: u32 = 1;
203 static ref TWO: u32 = 2;
204 static ref THREE: u32 = 3;
205 static ref FOUR: u32 = {
222 vbuf: gfx::VertexBuffer<Vertex> = (),
223 out: gfx::RenderTarget<ColorFormat> = "Target0",
228 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
230 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
233 "Size of template specialization: ",
234 stringify!(HandleWithDtor<::std::os::raw::c_int>)
238 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
241 "Alignment of template specialization: ",
242 stringify!(HandleWithDtor<::std::os::raw::c_int>)
248 macro_rules! try_opt {
261 // macro call whose argument is an array with trailing comma.
264 str_searcher_ascii_haystack,
277 fn special_case_macros() {
279 let q = eprint!("{}", 1);
281 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
282 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
285 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
314 let q = eprintln!("{}", 1);
316 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
317 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
320 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
349 let q = format!("{}", 1);
351 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
352 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
355 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
384 let q = format_args!("{}", 1);
385 let r = format_args!(
386 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
387 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
389 let s = format_args!(
390 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
419 let q = print!("{}", 1);
421 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
422 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
425 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
454 let q = println!("{}", 1);
456 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
457 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
460 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
489 let q = unreachable!("{}", 1);
490 let r = unreachable!(
491 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
492 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
494 let s = unreachable!(
495 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
526 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
527 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
530 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
561 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
562 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
565 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
596 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
597 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
600 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
631 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
632 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
635 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
666 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
667 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
670 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
700 assert!(result == 42);
701 assert!(result == 42, "Ahoy there, {}!", target);
704 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
711 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
742 assert_eq!(left, right);
743 assert_eq!(left, right, "Ahoy there, {}!", target);
746 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
747 result, input, expected
750 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
751 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
752 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
760 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
768 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
797 write!(&mut s, "Ahoy there, {}!", target);
800 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
801 result, input, expected
805 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
834 writeln!(&mut s, "Ahoy there, {}!", target);
837 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
838 result, input, expected
842 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
875 pub fn foo(&self) -> Bar<foo!()> {}
879 fn macro_in_pattern_position() {
883 bar!(a, b, c,) => (),
884 baz!(1 + 2 + 3, quux.kaas()) => (),
886 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
887 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
894 pub macro bar($x: ident + $y: expr;) {
897 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
911 macro lex_err($kind: ident $(, $body: expr)*) {
912 Err(QlError::LexError(LexError::$kind($($body,)*)))
915 // Preserve trailing comma on item-level macro with `()` or `[]`.
916 methods![get, post, delete,];
917 methods!(get, post, delete,);