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 {
77 const A_CONST: A = A(1);
78 const B: B = B { field: 1 };
79 const C: C = C { b: B { field: 1 } };
83 let s2 = get_struct();
93 Enum::Struct { field: 0 };
111 let s: String = "foo".into();
119 unsafe { unsafe_fn() };
121 DropStruct { field: 0 };
124 DropEnum::Struct { field: 0 };
125 let mut a_mut = A(1);
127 let mut b_mut = B { field: 1 };
129 let mut c_mut = C { b: B { field: 1 } };