1 #![feature(box_syntax, fn_traits, unboxed_closures)]
2 #![warn(clippy::no_effect_underscore_binding)]
4 #![allow(path_statements)]
5 #![allow(clippy::deref_addrof)]
6 #![allow(clippy::redundant_field_names)]
15 Struct { field: i32 },
18 impl Drop for DropUnit {
24 impl Drop for DropStruct {
27 struct DropTuple(i32);
28 impl Drop for DropTuple {
33 Struct { field: i32 },
35 impl Drop for DropEnum {
46 fn get_number() -> i32 {
49 fn get_struct() -> Struct {
52 fn get_drop_struct() -> DropStruct {
53 DropStruct { field: 0 }
56 unsafe fn unsafe_fn() -> i32 {
62 impl FnOnce<(&str,)> for GreetStruct1 {
65 extern "rust-call" fn call_once(self, (who,): (&str,)) -> Self::Output {
66 println!("hello {}", who);
70 struct GreetStruct2();
72 impl FnOnce<(&str,)> for GreetStruct2 {
75 extern "rust-call" fn call_once(self, (who,): (&str,)) -> Self::Output {
76 println!("hello {}", who);
82 impl FnOnce<(&str,)> for GreetStruct3 {
85 extern "rust-call" fn call_once(self, (who,): (&str,)) -> Self::Output {
86 println!("hello {}", who);
92 let s2 = get_struct();
102 Enum::Struct { field: 0 };
120 let s: String = "foo".into();
123 let _penguin = || println!("Some helpful closure");
124 let _duck = Struct { field: 0 };
125 let _cat = [2, 4, 6, 8][2];
127 #[allow(clippy::no_effect)]
132 unsafe { unsafe_fn() };
133 let _used = get_struct();
136 DropStruct { field: 0 };
139 DropEnum::Struct { field: 0 };
140 GreetStruct1("world");
141 GreetStruct2()("world");
142 GreetStruct3 {}("world");