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) => {
160 b: types::Timestamptz,
169 init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
171 ]).par_map_inplace(|el| *el = 0.);
182 .collect::<Vec<_>>();
188 fn test(a: String, s: String, b: String) -> TestResult {
189 if a.find(&s).is_none() {
191 TestResult::from_bool(true)
193 TestResult::discard()
203 static ref ONE: u32 = 1;
204 static ref TWO: u32 = 2;
205 static ref THREE: u32 = 3;
206 static ref FOUR: u32 = {
223 vbuf: gfx::VertexBuffer<Vertex> = (),
224 out: gfx::RenderTarget<ColorFormat> = "Target0",
229 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
231 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
234 "Size of template specialization: ",
235 stringify!(HandleWithDtor<::std::os::raw::c_int>)
239 ::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>(),
242 "Alignment of template specialization: ",
243 stringify!(HandleWithDtor<::std::os::raw::c_int>)
249 macro_rules! try_opt {
262 // macro call whose argument is an array with trailing comma.
265 str_searcher_ascii_haystack,
278 fn special_case_macros() {
280 let q = eprint!("{}", 1);
282 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
283 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
286 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
315 let q = eprintln!("{}", 1);
317 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
318 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
321 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
350 let q = format!("{}", 1);
352 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
353 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
356 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
385 let q = format_args!("{}", 1);
386 let r = format_args!(
387 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
388 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
390 let s = format_args!(
391 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
420 let q = print!("{}", 1);
422 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
423 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
426 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
455 let q = println!("{}", 1);
457 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
458 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
461 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
490 let q = unreachable!("{}", 1);
491 let r = unreachable!(
492 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
493 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
495 let s = unreachable!(
496 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
527 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
528 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
531 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
562 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
563 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
566 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
597 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
598 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
601 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
632 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
633 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
636 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
667 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
668 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
671 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
701 assert!(result == 42);
702 assert!(result == 42, "Ahoy there, {}!", target);
705 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
712 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
743 assert_eq!(left, right);
744 assert_eq!(left, right, "Ahoy there, {}!", target);
747 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
748 result, input, expected
751 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
752 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
753 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
761 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
769 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
798 write!(&mut s, "Ahoy there, {}!", target);
801 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
802 result, input, expected
806 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
835 writeln!(&mut s, "Ahoy there, {}!", target);
838 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
839 result, input, expected
843 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
876 pub fn foo(&self) -> Bar<foo!()> {}
880 fn macro_in_pattern_position() {
884 bar!(a, b, c,) => (),
885 baz!(1 + 2 + 3, quux.kaas()) => (),
887 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
888 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
896 pub macro bar($x: ident + $y: expr;) {
899 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
913 macro lex_err($kind: ident $(, $body: expr)*) {
914 Err(QlError::LexError(LexError::$kind($($body,)*)))