1 // rustfmt-normalize_comments: true
2 // rustfmt-format_macro_matchers: true
3 itemmacro!(this, is.now() .formatted(yay));
5 itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());
7 itemmacro!{this, is.brace().formatted()}
18 baz!(1+2+3, quux. kaas());
20 quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
22 kaas!(/* comments */ a /* post macro */, b /* another */);
24 trailingcomma!( a , b , c , );
25 // Preserve trailing comma only when necessary.
28 table.map(|table| fixture.offset(table)).unwrap_or(0),
32 noexpr!( i am not an expression, OK? );
36 vec! [AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA,
37 BBBBB, 5, 100-30, 1.33, b, b, b];
39 vec! [a /* comment */];
41 // Trailing spaces after a comma
53 vec![a; (|x| { let y = x + 1; let z = y + 1; z })(2)];
54 vec![a; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx];
59 unknown_bracket_macro__comma_should_not_be_stripped![
67 macrowithbraces! {dont, format, me}
92 let image = gray_image!(
98 chain!(input, a:take!(max_size), || []);
111 println!("dsfs"); // a comment
115 let hello = &format!("HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
116 "65454654654654654654654655464",
122 (#[$attr:meta] $name:ident) => {}
125 foo!(#[doc = "bar"] baz);
129 sql_function!(add_rss_item,
132 b: types::Timestamptz,
137 w.slice_mut(s![.., init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1], ..])
138 .par_map_inplace(|el| *el = 0.);
142 let threads = people.into_iter().map(|name| {
146 }).collect::<Vec<_>>();
152 fn test(a: String, s: String, b: String) -> TestResult {
153 if a.find(&s).is_none() {
155 TestResult::from_bool(true)
157 TestResult::discard()
167 static ref ONE: u32 = 1;
168 static ref TWO: u32 = 2;
169 static ref THREE: u32 = 3;
170 static ref FOUR: u32 = {
189 if let Some(debug) = error.debug_info() {
191 "errorKind": format!("{:?}", error.err_kind()),
192 "debugMessage": debug.message,
195 json!({"errorKind": format!("{:?}", error.err_kind())})
200 vbuf: gfx::VertexBuffer<Vertex> = (),
201 out: gfx::RenderTarget<ColorFormat> = "Target0",
206 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
208 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
211 "Size of template specialization: ",
212 stringify ! ( HandleWithDtor < :: std :: os :: raw :: c_int > )
215 assert_eq ! ( :: std :: mem :: align_of :: < HandleWithDtor < :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( HandleWithDtor < :: std :: os :: raw :: c_int > ) ) );
219 macro_rules! try_opt {
220 ($expr:expr) => (match $expr {
223 None => { return None; }
228 // macro call whose argument is an array with trailing comma.
230 make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [
239 fn special_case_macros() {
241 let q = eprint!("{}", 1);
242 let r = eprint!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
243 let s = eprint!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
245 let q = eprintln!("{}", 1);
246 let r = eprintln!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
247 let s = eprintln!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
249 let q = format!("{}", 1);
250 let r = format!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
251 let s = format!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
253 let q = format_args!("{}", 1);
254 let r = format_args!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
255 let s = format_args!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
257 let q = print!("{}", 1);
258 let r = print!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
259 let s = print!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
261 let q = println!("{}", 1);
262 let r = println!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
263 let s = println!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
265 let q = unreachable!("{}", 1);
266 let r = unreachable!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
267 let s = unreachable!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
270 debug!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
271 debug!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
274 error!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
275 error!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
278 info!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
279 info!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
282 panic!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
283 panic!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
286 warn!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
287 warn!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
290 assert!(result == 42);
291 assert!(result == 42, "Ahoy there, {}!", target);
292 assert!(result == 42, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
293 assert!(result == 42, "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
297 assert_eq!(left, right);
298 assert_eq!(left, right, "Ahoy there, {}!", target);
299 assert_eq!(left, right, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
300 assert_eq!(first_realllllllllllly_long_variable_that_doesnt_fit_one_one_line, second_reallllllllllly_long_variable_that_doesnt_fit_one_one_line, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
301 assert_eq!(left + 42, right, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
302 assert_eq!(left, right, "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
304 write!(&mut s, "Ahoy there, {}!", target);
305 write!(&mut s, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
306 write!(&mut s, "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
308 writeln!(&mut s, "Ahoy there, {}!", target);
309 writeln!(&mut s, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
310 writeln!(&mut s, "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
316 pub fn foo(&self) -> Bar<foo!( )> {}
320 fn macro_in_pattern_position () {
329 baz!( 1 + 2 + 3, quux.kaas( )
331 quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) => (),
340 pub macro bar($x:ident+$y:expr; ) {
342 long_function(a_long_argument_to_a_long_function_is_what_this_is(AAAAAAAAAAAAAAAAAAAAAAAAAAAA),
360 macro lex_err($kind: ident $(, $body: expr)*) {
361 Err(QlError::LexError(LexError::$kind($($body,)*)))
364 // Preserve trailing comma on item-level macro with `()` or `[]`.
365 methods![ get, post, delete, ];
366 methods!( get, post, delete, );
386 _ => unreachable!(/* obviously */),
391 let _ = column!(/* here */);
395 // Preserve trailing comma when using mixed layout for macro call.
397 foo!(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, 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);
398 foo!(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, 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,);
402 // Preserve trailing comma-less/ness inside nested macro.
404 do_parse_gsv<GsvData>,
407 number_of_sentences: map_res!(digit, parse_num::<u16>)
409 >> sentence_index: map_res!(digit, parse_num::<u16>)
411 >> total_number_of_sats: map_res!(digit, parse_num::<u16>)
413 >> sat0: opt!(complete!(parse_gsv_sat_info))
414 >> sat1: opt!(complete!(parse_gsv_sat_info))
415 >> sat2: opt!(complete!(parse_gsv_sat_info))
416 >> sat3: opt!(complete!(parse_gsv_sat_info))
420 total_number_of_sats,
432 convert_args!(vec!(1, 2, 3));
436 /// TLV Holds a set of JSTraceables that need to be rooted
437 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
438 RefCell::new(RootedTraceableSet::new()) ;
442 /// TLV Holds a set of JSTraceables that need to be rooted
443 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
444 RefCell::new(RootedTraceableSet::new()) ;
446 /// TLV Holds a set of JSTraceables that need to be rooted
447 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
448 RefCell::new(RootedTraceableSet::new(0)) ;
450 /// TLV Holds a set of JSTraceables that need to be rooted
451 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
452 RefCell::new(RootedTraceableSet::new(), xxx, yyy) ;
454 /// TLV Holds a set of JSTraceables that need to be rooted
455 static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> =
456 RefCell::new(RootedTraceableSet::new(1234)) ;
462 stringify!(( foo+ ));
466 pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
468 extern_token: Token ! [ extern ](tokens_helper(_visitor, &_i.extern_token.span)),
469 name: (_i.name).map(|it| _visitor.fold_lit_str(it)),
480 (3, false), // Missing