1 // rustfmt-normalize_comments: true
2 itemmacro!(this, is.now() .formatted(yay));
4 itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());
6 itemmacro!{this, is.bracket().formatted()}
8 peg_file! modname ("mygrammarfile.rustpeg");
17 baz!(1+2+3, quux. kaas());
19 quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
21 kaas!(/* comments */ a /* post macro */, b /* another */);
23 trailingcomma!( a , b , c , );
24 // Preserve trailing comma only when necessary.
27 table.map(|table| fixture.offset(table)).unwrap_or(0),
31 noexpr!( i am not an expression, OK? );
35 vec! [AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA,
36 BBBBB, 5, 100-30, 1.33, b, b, b];
38 vec! [a /* comment */];
40 // Trailing spaces after a comma
52 vec![a; (|x| { let y = x + 1; let z = y + 1; z })(2)];
53 vec![a; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx];
58 unknown_bracket_macro__comma_should_not_be_stripped![
66 macrowithbraces! {dont, format, me}
91 let image = gray_image!(
97 chain!(input, a:take!(max_size), || []);
105 println!("dsfs"); // a comment
109 let hello = &format!("HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
110 "65454654654654654654654655464",
116 (#[$attr:meta] $name:ident) => {}
119 foo!(#[doc = "bar"] baz);
123 sql_function!(add_rss_item,
126 b: types::Timestamptz,
131 w.slice_mut(s![.., init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1], ..])
132 .par_map_inplace(|el| *el = 0.);
136 let threads = people.into_iter().map(|name| {
140 }).collect::<Vec<_>>();
146 fn test(a: String, s: String, b: String) -> TestResult {
147 if a.find(&s).is_none() {
149 TestResult::from_bool(true)
151 TestResult::discard()
161 static ref ONE: u32 = 1;
162 static ref TWO: u32 = 2;
163 static ref THREE: u32 = 3;
164 static ref FOUR: u32 = {
181 vbuf: gfx::VertexBuffer<Vertex> = (),
182 out: gfx::RenderTarget<ColorFormat> = "Target0",
187 fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
189 ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
192 "Size of template specialization: ",
193 stringify ! ( HandleWithDtor < :: std :: os :: raw :: c_int > )
196 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 > ) ) );
200 macro_rules! try_opt {
201 ($expr:expr) => (match $expr {
204 None => { return None; }
209 // macro call whose argument is an array with trailing comma.
211 make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [
220 fn special_case_macros() {
222 let s = format!("Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
225 assert!(result, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);