2015-11-03 10:39:51 -06:00
|
|
|
// pp-exact
|
|
|
|
|
|
|
|
#![feature(box_syntax)]
|
2019-06-08 03:36:43 -05:00
|
|
|
#![feature(rustc_attrs)]
|
2015-11-24 07:56:20 -06:00
|
|
|
#![feature(stmt_expr_attributes)]
|
2015-11-03 10:39:51 -06:00
|
|
|
|
|
|
|
fn main() { }
|
|
|
|
|
|
|
|
fn _0() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
foo();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn _1() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
unsafe {
|
|
|
|
// code
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn _2() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
{ foo(); }
|
|
|
|
|
|
|
|
{
|
2019-06-08 03:36:43 -05:00
|
|
|
#![rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
|
|
|
|
foo()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn _3() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
match () { _ => { } }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn _4() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
match () {
|
2019-06-08 03:36:43 -05:00
|
|
|
#![rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
|
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] match () {
|
|
|
|
#![rustc_dummy]
|
|
|
|
() => (),
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _5() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
let x = 1;
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
let x = #[rustc_dummy] 1;
|
2015-11-03 10:39:51 -06:00
|
|
|
|
|
|
|
let y = ();
|
|
|
|
let z = ();
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
foo3(x, #[rustc_dummy] y, z);
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
qux(3 + #[rustc_dummy] 2);
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _6() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
[#![rustc_dummy] 1, 2, 3];
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] [#![rustc_dummy] 1, 2, 3];
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
[#![rustc_dummy] 1; 4];
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] [#![rustc_dummy] 1; 4];
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Foo {
|
|
|
|
data: (),
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar(());
|
|
|
|
|
|
|
|
fn _7() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
Foo{#![rustc_dummy] data: (),};
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (),};
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _8() {
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
(#![rustc_dummy] );
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
(#![rustc_dummy] 0);
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
(#![rustc_dummy] 0,);
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
(#![rustc_dummy] 0, 1);
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _9() {
|
2019-07-13 12:35:46 -05:00
|
|
|
macro_rules!
|
|
|
|
stmt_mac
|
2019-07-13 15:08:29 -05:00
|
|
|
{() => {let _ = () ; } }
|
2015-11-03 10:39:51 -06:00
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
stmt_mac!();
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
stmt_mac!{ };
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
stmt_mac![];
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
|
|
|
stmt_mac!{ }
|
2015-11-03 10:39:51 -06:00
|
|
|
|
|
|
|
let _ = ();
|
|
|
|
}
|
|
|
|
|
2019-07-13 15:08:29 -05:00
|
|
|
macro_rules! expr_mac {() => {() } }
|
2015-11-03 10:39:51 -06:00
|
|
|
|
|
|
|
fn _10() {
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] expr_mac!();
|
|
|
|
let _ = #[rustc_dummy] expr_mac![];
|
|
|
|
let _ = #[rustc_dummy] expr_mac!{ };
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _11() {
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] box 0;
|
|
|
|
let _: [(); 0] = #[rustc_dummy] [#![rustc_dummy] ];
|
|
|
|
let _ = #[rustc_dummy] [#![rustc_dummy] 0, 0];
|
|
|
|
let _ = #[rustc_dummy] [#![rustc_dummy] 0; 0];
|
|
|
|
let _ = #[rustc_dummy] foo();
|
|
|
|
let _ = #[rustc_dummy] 1i32.clone();
|
|
|
|
let _ = #[rustc_dummy] (#![rustc_dummy] );
|
|
|
|
let _ = #[rustc_dummy] (#![rustc_dummy] 0);
|
|
|
|
let _ = #[rustc_dummy] (#![rustc_dummy] 0,);
|
|
|
|
let _ = #[rustc_dummy] (#![rustc_dummy] 0, 0);
|
|
|
|
let _ = #[rustc_dummy] 0 + #[rustc_dummy] 0;
|
|
|
|
let _ = #[rustc_dummy] !0;
|
|
|
|
let _ = #[rustc_dummy] -0i32;
|
|
|
|
let _ = #[rustc_dummy] false;
|
|
|
|
let _ = #[rustc_dummy] 'c';
|
|
|
|
let _ = #[rustc_dummy] 0;
|
|
|
|
let _ = #[rustc_dummy] 0 as usize;
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] while false {
|
|
|
|
#![rustc_dummy]
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] while let None = Some(()) {
|
|
|
|
#![rustc_dummy]
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] for _ in 0..0 {
|
|
|
|
#![rustc_dummy]
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
// FIXME: pp bug, two spaces after the loop
|
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] loop {
|
|
|
|
#![rustc_dummy]
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] match false {
|
|
|
|
#![rustc_dummy]
|
|
|
|
_ => (),
|
|
|
|
};
|
|
|
|
let _ = #[rustc_dummy] || #[rustc_dummy] ();
|
|
|
|
let _ = #[rustc_dummy] move || #[rustc_dummy] ();
|
2016-10-26 02:43:34 -05:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] ||
|
|
|
|
{
|
|
|
|
#![rustc_dummy]
|
|
|
|
#[rustc_dummy]
|
|
|
|
()
|
|
|
|
};
|
2016-10-26 02:43:34 -05:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] move ||
|
|
|
|
{
|
|
|
|
#![rustc_dummy]
|
|
|
|
#[rustc_dummy]
|
|
|
|
()
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] {
|
|
|
|
#![rustc_dummy]
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] {
|
|
|
|
#![rustc_dummy]
|
|
|
|
let _ = ();
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ =
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy] {
|
|
|
|
#![rustc_dummy]
|
|
|
|
let _ = ();
|
|
|
|
()
|
|
|
|
};
|
2015-11-03 10:39:51 -06:00
|
|
|
let mut x = 0;
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] x = 15;
|
|
|
|
let _ = #[rustc_dummy] x += 15;
|
2015-11-03 10:39:51 -06:00
|
|
|
let s = Foo{data: (),};
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] s.data;
|
|
|
|
let _ = (#[rustc_dummy] s).data;
|
2015-11-03 10:39:51 -06:00
|
|
|
let t = Bar(());
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] t.0;
|
|
|
|
let _ = (#[rustc_dummy] t).0;
|
2015-11-03 10:39:51 -06:00
|
|
|
let v = vec!(0);
|
2019-06-08 03:36:43 -05:00
|
|
|
let _ = #[rustc_dummy] v[0];
|
|
|
|
let _ = (#[rustc_dummy] v)[0];
|
|
|
|
let _ = #[rustc_dummy] 0..#[rustc_dummy] 0;
|
|
|
|
let _ = #[rustc_dummy] 0..;
|
|
|
|
let _ = #[rustc_dummy] (0..0);
|
|
|
|
let _ = #[rustc_dummy] (0..);
|
|
|
|
let _ = #[rustc_dummy] (..0);
|
|
|
|
let _ = #[rustc_dummy] (..);
|
|
|
|
let _: fn(&u32) -> u32 = #[rustc_dummy] std::clone::Clone::clone;
|
|
|
|
let _ = #[rustc_dummy] &0;
|
|
|
|
let _ = #[rustc_dummy] &mut 0;
|
|
|
|
let _ = #[rustc_dummy] &#[rustc_dummy] 0;
|
|
|
|
let _ = #[rustc_dummy] &mut #[rustc_dummy] 0;
|
2015-11-03 10:39:51 -06:00
|
|
|
// FIXME: pp bug, extra space after keyword?
|
2019-06-08 03:36:43 -05:00
|
|
|
while false { let _ = #[rustc_dummy] continue ; }
|
|
|
|
while true { let _ = #[rustc_dummy] break ; }
|
|
|
|
|| #[rustc_dummy] return;
|
|
|
|
let _ = #[rustc_dummy] expr_mac!();
|
|
|
|
let _ = #[rustc_dummy] expr_mac![];
|
|
|
|
let _ = #[rustc_dummy] expr_mac!{ };
|
|
|
|
let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (),};
|
|
|
|
let _ = #[rustc_dummy] Foo{#![rustc_dummy] ..s};
|
|
|
|
let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (), ..s};
|
|
|
|
let _ = #[rustc_dummy] (#![rustc_dummy] 0);
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn _12() {
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
let _ = 0;
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
0;
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
expr_mac!();
|
|
|
|
|
2019-06-08 03:36:43 -05:00
|
|
|
#[rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
{
|
2019-06-08 03:36:43 -05:00
|
|
|
#![rustc_dummy]
|
2015-11-03 10:39:51 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/////////////////
|
|
|
|
|
|
|
|
fn foo() { }
|
|
|
|
fn foo3(_: i32, _: (), _: ()) { }
|
|
|
|
fn qux(_: i32) { }
|