]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/loop-scope.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / loop-scope.rs
index fc5618d823df41cb1c4fbe3ab531d62aac478940..4b8ccad068cc7870fe906eed72a073c6e616e747 100644 (file)
@@ -1,6 +1,16 @@
-fn main() {
-    let x = ~[10, 20, 30];
-    let sum = 0;
-    for x in x { sum += x; }
-    assert (sum == 60);
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// 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.
+
+pub fn main() {
+    let x = vec!(10i, 20i, 30i);
+    let mut sum = 0i;
+    for x in x.iter() { sum += *x; }
+    assert_eq!(sum, 60);
 }