1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
13 #![feature(box_syntax)]
16 #![warn(clippy::no_effect)]
18 #![allow(path_statements)]
19 #![allow(clippy::deref_addrof)]
20 #![allow(clippy::redundant_field_names)]
21 #![feature(untagged_unions)]
30 Struct { field: i32 },
33 impl Drop for DropUnit {
39 impl Drop for DropStruct {
42 struct DropTuple(i32);
43 impl Drop for DropTuple {
48 Struct { field: i32 },
50 impl Drop for DropEnum {
61 fn get_number() -> i32 { 0 }
62 fn get_struct() -> Struct { Struct { field: 0 } }
63 fn get_drop_struct() -> DropStruct { DropStruct { field: 0 } }
65 unsafe fn unsafe_fn() -> i32 { 0 }
69 let s2 = get_struct();
79 Enum::Struct { field: 0 };
97 let s: String = "foo".into();
102 unsafe { unsafe_fn() };
104 DropStruct { field: 0 };
107 DropEnum::Struct { field: 0 };