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.
10 #![feature(box_syntax)]
11 #![warn(clippy::no_effect)]
13 #![allow(path_statements)]
14 #![allow(clippy::deref_addrof)]
15 #![allow(clippy::redundant_field_names)]
16 #![feature(untagged_unions)]
25 Struct { field: i32 },
28 impl Drop for DropUnit {
34 impl Drop for DropStruct {
37 struct DropTuple(i32);
38 impl Drop for DropTuple {
43 Struct { field: i32 },
45 impl Drop for DropEnum {
56 fn get_number() -> i32 {
59 fn get_struct() -> Struct {
62 fn get_drop_struct() -> DropStruct {
63 DropStruct { field: 0 }
66 unsafe fn unsafe_fn() -> i32 {
72 let s2 = get_struct();
82 Enum::Struct { field: 0 };
100 let s: String = "foo".into();
105 unsafe { unsafe_fn() };
107 DropStruct { field: 0 };
110 DropEnum::Struct { field: 0 };