1 #![feature(box_syntax, fn_traits, unboxed_closures)]
2 #![warn(clippy::no_effect_underscore_binding)]
3 #![allow(dead_code, path_statements)]
4 #![allow(clippy::deref_addrof, clippy::redundant_field_names, clippy::uninlined_format_args)]
13 Struct { field: i32 },
16 impl Drop for DropUnit {
22 impl Drop for DropStruct {
25 struct DropTuple(i32);
26 impl Drop for DropTuple {
31 Struct { field: i32 },
33 impl Drop for DropEnum {
44 fn get_number() -> i32 {
47 fn get_struct() -> Struct {
50 fn get_drop_struct() -> DropStruct {
51 DropStruct { field: 0 }
54 unsafe fn unsafe_fn() -> i32 {
60 impl FnOnce<(&str,)> for GreetStruct1 {
63 extern "rust-call" fn call_once(self, (who,): (&str,)) -> Self::Output {
64 println!("hello {}", who);
68 struct GreetStruct2();
70 impl FnOnce<(&str,)> for GreetStruct2 {
73 extern "rust-call" fn call_once(self, (who,): (&str,)) -> Self::Output {
74 println!("hello {}", who);
80 impl FnOnce<(&str,)> for GreetStruct3 {
83 extern "rust-call" fn call_once(self, (who,): (&str,)) -> Self::Output {
84 println!("hello {}", who);
90 let s2 = get_struct();
100 Enum::Struct { field: 0 };
118 let s: String = "foo".into();
121 let _penguin = || println!("Some helpful closure");
122 let _duck = Struct { field: 0 };
123 let _cat = [2, 4, 6, 8][2];
125 #[allow(clippy::no_effect)]
130 unsafe { unsafe_fn() };
131 let _used = get_struct();
134 DropStruct { field: 0 };
137 DropEnum::Struct { field: 0 };
138 GreetStruct1("world");
139 GreetStruct2()("world");
140 GreetStruct3 {}("world");