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 {
249 ($expr:expr) => (match $expr {
252 None => { return None; }
257 // macro call whose argument is an array with trailing comma.
260 str_searcher_ascii_haystack,
273 fn special_case_macros() {
275 let q = eprint!("{}", 1);
277 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
278 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
281 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
310 let q = eprintln!("{}", 1);
312 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
313 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
316 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
345 let q = format!("{}", 1);
347 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
348 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
351 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
380 let q = format_args!("{}", 1);
381 let r = format_args!(
382 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
383 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
385 let s = format_args!(
386 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
415 let q = print!("{}", 1);
417 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
418 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
421 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
450 let q = println!("{}", 1);
452 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
453 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
456 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
485 let q = unreachable!("{}", 1);
486 let r = unreachable!(
487 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
488 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
490 let s = unreachable!(
491 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
522 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
523 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
526 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
557 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
558 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
561 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
592 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
593 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
596 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
627 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
628 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
631 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
662 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
663 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
666 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
696 assert!(result == 42);
697 assert!(result == 42, "Ahoy there, {}!", target);
700 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
707 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
738 assert_eq!(left, right);
739 assert_eq!(left, right, "Ahoy there, {}!", target);
742 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
743 result, input, expected
746 first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line,
747 second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line,
748 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
756 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
764 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
793 write!(&mut s, "Ahoy there, {}!", target);
796 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
797 result, input, expected
801 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
830 writeln!(&mut s, "Ahoy there, {}!", target);
833 "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
834 result, input, expected
838 "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
871 pub fn foo(&self) -> Bar<foo!()> {}
875 fn macro_in_pattern_position() {
879 bar!(a, b, c,) => (),
880 baz!(1 + 2 + 3, quux.kaas()) => (),
882 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
883 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
892 pub macro bar($x: ident + $y: expr;) {
895 a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
909 macro lex_err($kind: ident $(, $body: expr)*) {
910 Err(QlError::LexError(LexError::$kind($($body,)*)))