1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![feature(custom_attribute)]
14 #![feature(box_syntax)]
15 #![feature(placement_in_syntax)]
16 #![feature(stmt_expr_attributes)]
77 foo3(x
, #[attr] y, z);
87 let _
= #[attr] [#![attr] 1, 2, 3];
92 let _
= #[attr] [#![attr] 1; 4];
104 Foo{#![attr] data: (),}
;
106 let _
= #[attr] Foo{#![attr] data: (),};
125 macro_rules
! stmt_mac(( ) => { let _ = ( ) ; }
);
131 // pre existing pp bug: delimiter styles gets lost:
140 stmt_mac!{ } // pre-existing pp bug: compiler ICEs with a None unwrap
146 macro_rules
! expr_mac(( ) => { ( ) }
);
150 let _
= #[attr] expr_mac!();
153 // pre existing pp bug: delimiter styles gets lost:
154 let _ = #[attr] expr_mac![];
155 let _ = #[attr] expr_mac!{};
160 let _
= #[attr] box 0;
161 let _
: [(); 0] = #[attr] [#![attr] ];
162 let _
= #[attr] [#![attr] 0, 0];
163 let _
= #[attr] [#![attr] 0; 0];
164 let _
= #[attr] foo();
165 let _
= #[attr] 1i32.clone();
166 let _
= #[attr] (#![attr] );
167 let _
= #[attr] (#![attr] 0);
168 let _
= #[attr] (#![attr] 0,);
169 let _
= #[attr] (#![attr] 0, 0);
170 let _
= #[attr] 0 + #[attr] 0;
172 let _
= #[attr] -0i32;
173 let _
= #[attr] false;
176 let _
= #[attr] 0 as usize;
178 #[attr] while false {
182 #[attr] while let None = Some(()) {
186 #[attr] for _ in 0..0 {
189 // FIXME: pp bug, two spaces after the loop
195 #[attr] match false {
199 let _
= #[attr] || #[attr] ();
200 let _
= #[attr] move || #[attr] ();
205 let _
= #[attr] move || {
225 let _
= #[attr] x = 15;
226 let _
= #[attr] x += 15;
227 let s
= Foo{data: (),}
;
228 let _
= #[attr] s.data;
229 let _
= (#[attr] s).data;
232 let _
= (#[attr] t).0;
234 let _
= #[attr] v[0];
235 let _
= (#[attr] v)[0];
236 let _
= #[attr] 0..#[attr] 0;
238 let _
= #[attr] (0..0);
239 let _
= #[attr] (0..);
240 let _
= #[attr] (..0);
241 let _
= #[attr] (..);
242 let _
: fn(&u32) -> u32 = #[attr] std::clone::Clone::clone;
244 let _
= #[attr] &mut 0;
245 let _
= #[attr] &#[attr] 0;
246 let _
= #[attr] &mut #[attr] 0;
247 // FIXME: pp bug, extra space after keyword?
248 while false { let _ = #[attr] continue ; }
249 while true { let _ = #[attr] break ; }
251 let _
= #[attr] expr_mac!();
252 /* FIXME: pp bug, loosing delimiter styles
253 let _ = #[attr] expr_mac![];
254 let _ = #[attr] expr_mac!{};
256 let _
= #[attr] Foo{#![attr] data: (),};
257 let _
= #[attr] Foo{#![attr] ..s};
258 let _
= #[attr] Foo{#![attr] data: (), ..s};
259 let _
= #[attr] (#![attr] 0);
281 fn foo3(_
: i32, _
: (), _
: ()) { }