]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-fail/bug-2470-bounds-check-overflow.rs
Use better bound names in `-Zverbose` mode
[rust.git] / src / test / run-fail / bug-2470-bounds-check-overflow.rs
index 5e3da8476af3fe8f5c74f982c4e8b8f28e620755..b4e3f2469911883b437cc6c305a6adca5e0bc070 100644 (file)
@@ -1,13 +1,3 @@
-// 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.
-
 // error-pattern:index out of bounds
 
 use std::mem;
@@ -20,7 +10,7 @@ fn main() {
     // address of the 0th cell in the array (even though the index is
     // huge).
 
-    let x = vec!(1_usize,2_usize,3_usize);
+    let x = vec![1_usize, 2_usize, 3_usize];
 
     let base = x.as_ptr() as usize;
     let idx = base / mem::size_of::<usize>();
@@ -28,7 +18,7 @@ fn main() {
     println!("ov1 idx = 0x{:x}", idx);
     println!("ov1 sizeof::<usize>() = 0x{:x}", mem::size_of::<usize>());
     println!("ov1 idx * sizeof::<usize>() = 0x{:x}",
-           idx * mem::size_of::<usize>());
+             idx * mem::size_of::<usize>());
 
     // This should panic.
     println!("ov1 0x{:x}", x[idx]);