]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/no_effect.rs
iterate List by value
[rust.git] / tests / ui / no_effect.rs
index bee3aeb6f7f2b8ea6c3fefb5ea26e9a5b875ebec..8fbfcb79860a58aa889b872a4c1b663bcf33ed64 100644 (file)
@@ -1,18 +1,4 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-
-
 #![feature(box_syntax)]
-
-
 #![warn(clippy::no_effect)]
 #![allow(dead_code)]
 #![allow(path_statements)]
@@ -23,7 +9,7 @@
 struct Unit;
 struct Tuple(i32);
 struct Struct {
-    field: i32
+    field: i32,
 }
 enum Enum {
     Tuple(i32),
@@ -34,7 +20,7 @@ impl Drop for DropUnit {
     fn drop(&mut self) {}
 }
 struct DropStruct {
-    field: i32
+    field: i32,
 }
 impl Drop for DropStruct {
     fn drop(&mut self) {}
@@ -58,11 +44,19 @@ union Union {
     b: f64,
 }
 
-fn get_number() -> i32 { 0 }
-fn get_struct() -> Struct { Struct { field: 0 } }
-fn get_drop_struct() -> DropStruct { DropStruct { field: 0 } }
+fn get_number() -> i32 {
+    0
+}
+fn get_struct() -> Struct {
+    Struct { field: 0 }
+}
+fn get_drop_struct() -> DropStruct {
+    DropStruct { field: 0 }
+}
 
-unsafe fn unsafe_fn() -> i32 { 0 }
+unsafe fn unsafe_fn() -> i32 {
+    0
+}
 
 fn main() {
     let s = get_struct();